Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 14 of 23

CiMAX 78xx Scanner Technical Reference Manual: CHAPTER 6 Host Commands & Downloads, pages 117 to 126

Pages 117 to 126 of 201, from CiMAX 78xx Scanner Technical Reference Manual

The original document is the PDF (2.8 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the RVSI CiMatrix 7800, Sick 7850 and Siemens 7800

Page 117

Control Commands from the Host

~VER~ Command This command, when sent over STARNODE or TCP/IP, must be prefixed with / . This command will return the version of all installed software modules currently operating within the scanner. The user program currently stored in the scanner will be displayed. If there is no user program, the user program line will not be displayed. The following information will be returned: PREBOOT VX.X FLASH ROM BOOT MONITOR VX.X CIDSP-Non-Stitching Auto-distinguish (5 symbologies) for Scanner: Ver X.X TPU Functions Ver X.X User Program: xxxxx CiMAX 7800 Ver. X.X

Host Commands & Downloads

6

Rev H, February 2002

CiMAX 78xx Technical Reference Manual

6-21

Page 118

Chapter

6

Host Commands & Downloads

Gap Tracking Diagnostic Commands You can request the software version and all of the Gap Tracking diagnostic data from any port. Note: The tildes ( ~ ) are required through the Host and Setup ports, but are not used through the Starnode and Ethernet ports. Over the Starnode and Ethernet ports, you must precede each command with a / , to indicate that it is a command. Otherwise, all strings that begin with an ASCII A or greater will be sent to the user program as data. The format of the data returned from the scanner is described in “Gap Tracking Diagnostics” on page 8-24. These commands are: •

~TRACK~ - Returns beam coordinates

•

~TIMES~ - Returns beam timestamp limits

•

~TOLER~ - Returns outzone deviation statistics for last eight boxes

The following commands can only be used when parameter 012 NORMMD RPT = 4 •

~TRAKS~ - Returns most recent collected tracking information of barcodes that fit on a box

•

~TRAKN~ - Returns most recent collected tracking information of barcodes that did not fit on a box •

~TRUNC~ - Returns most recent collected truncation information

C Program Control Commands Upload C Programs to the Host Computer (ASCII 91) Command The host command ?91 is used to extract or upload a user C program from the scanner. The program is sent as ASCII Motorola S-records, framed appropriately for the port that sent the command. For example, if a ~?91~ is sent to the scanner over the Host or Setup port, the S-records are framed with a tilde (~). This framing is necessary in case the S-records are saved to a .sef file by a terminal emulation or other program, so that file can be downloaded to the scanner later. Similarly, S-records sent to the Starnode or Ethernet port are framed in the .LAN file format. This feature is useful for extracting a user program from a scanner when the original .sef or .lan file is not available, for use in a replacement scanner, or to save the program before a new version of the operating system is downloaded. This is especially useful when the program cannot be saved in FLASH memory because it is larger than 8Kbytes. Note: Only the program’s code and constant data segments are sent. It is important that the host program that is saving the S-records to a file does not drop any characters as the data is received. XON/XOFF protocol is supported by the scanner if required over the serial ports.

6-22

CiMAX 78xx Technical Reference Manual

Rev H, February 2002

Page 119

C Programming Considerations

Erase C Program (ASCII 92) Command This command causes the scanner to erase the C program currently stored in NOVRAM. This allows the program to be erased without affecting current parameter values or any data stored in NOVRAM. This does not remove the user program from Flash. You must store another user program to flash.

Example If the default MESSAGE CHARACTER value is not changed, an Erase C Program command would be downloaded as: ~?92~ The scanner would then erase its C program from NOVRAM. The scanner must then be reset by downloading the RESET command ~;~

Stop C Program (ASCII 93) Command The program will stop running but will still be in NOVRAM if ~?93~ is downloaded. The program start again following the next scanner reset.

Suspend C Program (ASCII 94) Command The program will be suspended if ~?94~ is downloaded.

The program will be resumed by downloading ~?95~

C Programming Considerations C programming allows customized application programs to be developed on an ordinary PC and then downloaded to the scanner. The C programming language provides a robust platform with advanced data structures and operators, economical syntax, and advanced flow control capability. The SICK Auto Ident, Inc. User Library provides functions well suited to formatting scanned label data, providing special relay control, and other important functions that typically arise in industrial bar code scanning applications.

Compiling C Programs for Download C programs can be developed and compiled on any PC-compatible computer equipped with either an RS-232 serial port or a Starnode PC Interface Board. The C program can then be loaded into the scanner through any RS-232 serial port or it can be loaded over the Starnode network. The C compiler can be configured to produce a .LAN download file (for Starnode environments) or a .SEF file (for RS-232 serial downloading). Any terminal emulation program, for example, ProComm or Windows Terminal, can be used to download the program. Consult the C Programming Platform User Manual for complete information on C programming.

Rev H, February 2002

CiMAX 78xx Technical Reference Manual

6-23

Host Commands & Downloads

6

Resume C Program (ASCII 95) Command

Page 120

Chapter

6

Host Commands & Downloads

Installing C Programming Platform To install the C programming platform on your hard disk, perform the following steps: 1.

Insert the diskette labeled C Programming Platform Disk 1 in your floppy disk drive.

2.

Type: A (or B):INSTALL

3.

Follow the screen prompts. The installation requires about 4Mb of hard disk space.

4.

Modify your AUTOEXEC.BAT file to add the line: SET INCLUDE=c:\CISOFT\C68K\INC

5.

Modify your AUTOEXEC.BAT file so that your path declaration includes the following line: C:\CISOFT\C68K\BIN

Downloading C Programs (.sef) To download a C program to the scanner, follow the steps below: 1.

Modify or create a C source file with an ASCII text editor.

2.

Compile the source file to create an object file.

3.

Link the object file and the libraries into an executable file.

4.

Format the executable file into Motorola hex format.

5.

Frame the executable file so that it can be downloaded to the scanner.

6.

Download the framed file to the scanner.

Note: A complete discussion of C programming is beyond the scope of this manual. However, a simple example is given below to illustrate how to run a custom program on the scanner.

Example 1.

Using a text editor which creates flat ASCII files (such as DOS Edit or Windows Notepad), create a C program. Here is a simple example that you can enter: #include <stdio.h> #include <stdlib.h> /* User must define "program_name"*/ char *program_name = "HELLO";

6-24

CiMAX 78xx Technical Reference Manual

Rev H, February 2002

Page 121

C Programming Considerations void main(void) { print("Hello World"); sleep(5000L); stop(); } Save the program with a name extension of .c. This program is contained in the CISOFT\C68K\EXAMPLE\HELLO directory created by the INSTALL Program on your C programming language diskette. Note: Steps 2 - 5 have been automated via a batch file, C68K.BAT, included in the directory C:\CISOFT\C68K\EXAMPLE/HELLO. If you wish, type C68K HELLO to execute these steps automatically. 2.

From the directory C:\CISOFT\C68K\EXAMPLE\HELLO, to compile the program, type: ..\..\bin\c68332 hello.c -sd -L -I..\..\inc -o hello.o1 -1 hello.lst

For more information on the use of the C Compiler, refer to the SICK Auto Ident, Inc. C Programming Platform Users Manual that accompanies your C programming platform. From the directory C:\CISOFT\C68K\EXAMPLE\HELLO, to link the program to your program object module, type: ..\..\bin\LLINK hello.o1 -L ..\..\LIB\rtlib.1 -c ..\..loc\ssCiMAX7500.loc -o hello.rmp -b _S_data -rs sdata -rc isep stsep 4.

From the directory C:\CISOFT\C68K\EXAMPLE\HELLO, to convert the object file to Motorola hex format, type: ..\..\bin\FORM hello.rmp -ec usep

5.

From the directory C:\CISOFT\C68K\EXAMPLE\HELLO, to frame Motorola S-records for serial block download by CICOMM, type: ..\..\bin\exec\ciframe hello.hex

6.

Start up your terminal emulation program, and verify communication by typing: ~5~ You should receive a reply similar to the following: 7800 X.X 00000010100000000 If you receive no reply, there is a problem with your connections or serial communication parameters, or both. When you are assured that your PC and the scanner are communicating, you can download the program. Using the terminal emulation program, send the serial-framed program (hello.sef) to the scanner by using straight ASCII file transfer (usually called UPLOAD). As the program is

Rev H, February 2002

CiMAX 78xx Technical Reference Manual

6-25

6 Host Commands & Downloads

3.

Page 122

Chapter

6

Host Commands & Downloads being downloaded, you will see a line of periods (.) sent from the SetupP port, indicating each line being sent. When the download is complete, the scanner will reboot and then send the name of your program HELLO to the Setup port before running the program.

Downloading C Programs via Starnode (.LAN) The following steps outline the procedure for loading a C application program into a scanner connected to the Starnode data collection network. 1.

Ensure that the Starnode network is fully operational. If you need to install and check your Starnode network, read the Starnode Data Collection Network Site Planning and Installation Guide, and the Starnode PC Data Collection Network Operator's Manual.

2.

Configure the scanner for Starnode communications. Two parameters of the scanner's operating system must be set prior to Starnode communications. You cannot use the parameter defaults. You must set #401, Terminal ID number, and #402, Terminal Type number. Refer to the Scanner Parameters Reference Guide to change parameter values. After you set the two parameters, exit the Setup menu and look for the message WAITING FOR STARNODE on the hand-held or other terminal connected to the Setup port of the scanner. (If you kept the default parameter values, the scanner will ignore the Starnode network, emit three descending tones followed by three ascending tones and then turn on the laser beam.) The Terminal Type number is used in Step 8. Modify or create a C source file with an ASCII text editor. Using a text editor which creates ASCII files, such as DOS Edit or Windows Notepad, create a C program. An example you can enter is shown below: #include <stdio.h> #include <stdlib.h> /* User must define "program_name"*/ char *program_name = "HELLO"; void main(void) { printf("Hello World"); sleep(5000L); stop(); } Be sure to save the program with a name extension of .c.

6-26

CiMAX 78xx Technical Reference Manual

Rev H, February 2002

Page 123

C Programming Considerations

Compile the source file to create an executable file. From directory C:\CISOFT\C68K\EXAMPLE\HELLO, compile the program by typing: ..\..\bin\c68332 hello.c -sd -L -I..\..\inc -o hello.o1 -1 hello.lst

For more information on the use of the C Compiler, refer to the SICK Auto Ident, Inc. C Programming Platform User's Manual that accompanies your C programming platform. 3.

Link the object file and the libraries into an executable file. From the directory C:\CISOFT\C68K\EXAMPLE\HELLO, link the program to your program object module by typing: ..\..\bin\LLINK hello.o1 -L ..\..\LIB\rtlib.1 -c ..\..loc\ssCiMAX7500.loc -o hello.rmp -b _S_data -rs sdata -rc isep stsep

Format the executable file in Motorola hex format. From the directory C:\CISOFT\C68K\EXAMPLE\HELLO, convert the object file to Motorola hex format by typing: ..\..\bin\FORM hello.rmp -ec usep Format the executable file into Starnode format. From directory C:\CISOFT\C68K\EXAMPLE\HELLO, format Motorola S-records to Starnode LAN format by typing: ..\..\bin\lanremap hello.hex hello.lan Run the Starnode demonstration program, STARNDEM. The Starnode demo program will allow you to download the executable file to the scanner. STARNDEM.EXE is described in the Starnode PC Data Collection Network Operator's Manual. A detailed description of the PC board's operation during downloads can be found in the Starnode Data Collection Network Operators Manual. The interface routines (STBLC, STBLN, STBLB, and SINIT) that are involved in the process of downloading .LAN files. Download Program - Allows you to transmit a compiled *.LAN program to all terminals in the network of a specified type. Such downloads might be used for testing or demonstration of the network's capabilities. Note: If you specified Y (Yes) to the Full Initialization prompt and STARNDEM.CNF file was found, programs have already been downloaded. 1.

Rev H, February 2002

Opening the Transmit menu and selecting Download Program displays the Download Program dialog box, as shown in Figure 6–1.

CiMAX 78xx Technical Reference Manual

6-27

6 Host Commands & Downloads

4.

Page 124

Chapter

6

Host Commands & Downloads

FIGURE 6–1. Download Program Dialog Box

2.

Determine the terminal type that you want to download to. Click on Terminal Type field and enter the terminal type. Valid types are 001 to 128.

3.

Specify the *.LAN file to be downloaded by typing a complete path and program name in the File Name field or by clicking on the program name. To change the list of *.LAN files shown, select on a different path from the File Name list box.

If a different program was downloaded to the target terminals during a previous session, the later download takes the place of the previous one. After selecting a *.LAN file, click OK. The hourglass is displayed while the download is in progress, and then disappears when the download is complete. You may then select a new file name and/or terminal type and download to the next group of terminals.

Downloading .LAN Files - Starnode Asynchronous Controller MUX Interface C programs can be downloaded from a Starnode AC/CICALP using a host-based program or the SICK Auto Ident, Inc. SACDEM program running on a PC. If SACDEM is used, the program is invoked by typing SACDEM CR at the DOS prompt. When the Main Menu is shown, press F6 to initiate the download. SACDEM prompts for the name of the program to be downloaded, followed by the terminal type (valid values: 001 to 127) to receive this program. After a terminal type has been specified, the Starnode AC/CICALP initiates the download. The operation of the Starnode AC/MUX at power-up is determined by the values of the CLEAR PROGRAMS and AUTO INITIALIZE parameters of the MUX Interface Handler. Upon power-up, the Starnode AC/MUX will re-initialize the network; part of this process is downloading C programs stored in the controller's RAM. If no programs are found, the controller will send nothing. If desired, a download can be initiated at any time if the host sends a Full Initialization (decimal 20, hex 32) command to the Starnode AC/MUX. Upon receiving the command, the Starnode AC/MUX will re-initialize the entire Starnode network; if the MUX has any .LAN files in RAM, it will download them based upon terminal type. The controller will send an <ACK> or <NAK> back to the host, indicating the success or failure of the initialization.

6-28

CiMAX 78xx Technical Reference Manual

Rev H, February 2002

Page 125

Data Detection by C

A detailed description of Starnode AC/MUX operation during downloads can be found in the Starnode AC/MUX Operator's Manual.

Data Detection by C The following illustrates the programming features of the scanner. A C program normally waits for barcode data in one of two modes: •

Polling

•

Event Manager.

Polling 1.

Loop on system status using the function, get_dstatus(1, &dstatus) until dstruc.item1 is not zero.

2.

Loop on system status using the function, get_ustatus() until bit 1 (bar data pending) is ONE (TRUE). Bit 0 is the low order bit.

3.

Loop on data available by using the function: ret = dta_get(1, len, &str) Where:

str is allocated len characters until a non-zero value is returned to ret.

Event Manager Event Manager creates a data event using the function: data_event(1, TimeOut, &user_func, &parameter_list) This method causes a data event to occur when information on port 1 (bar code data) is buffered to the user program. When this buffer occurs, the event triggers shortly thereafter. If there is no data buffered by the time Timeout expires, the event still triggers the user function. Once the user function triggers, the function takes cState as a parameter. The value in cState indicates how the event was triggered. Additionally, the information in the user buffer can be retrieved by using the Polling mode above Step (3), from the user function dta_get. There may be occasions where reading the state of the inzone and outzone presence inputs would be of interest. The inzone and outzone presence inputs are normally assigned as input 1 and input 2, respectively, and can be sensed by a user program in one of two ways: •

Rev H, February 2002

By polling input 1 and/or 2 using the function d_inp(), until it returns the desired level in bit 7 or bit 6 for inzone and outzone, respectively.

CiMAX 78xx Technical Reference Manual

6-29

Host Commands & Downloads

6 len>0

Page 126

Chapter

6

Host Commands & Downloads

•

By creating an input event using the function: dinput(1, 1, TimeOut, &user_function, &parameter_list) This method senses a zero to one transition of the inzone presence input and then executes user_function with the parameters in parameter_list.

The presence inputs can be remapped by a C program if desired. Refer to the SICK Auto Ident, Inc. C Programmer's Platform Users Manual for complete information on the use of these routines.

6-30

CiMAX 78xx Technical Reference Manual

Rev H, February 2002