Omega manual Communication programs, Example a data transfer from CL526 to PC, Example B

Page 44

10.6Communication programs

In this paragraph are illustrated two examples of communication programs between the CL526 and an IBM or IBM compatible PC.

Example A: (data transfer from CL526 to PC)

Set IDNAME=1 and BAUD RATE=9600 on CL526 (see chapter 8.6). Connect CL526 through adapter BB530001 (TTL- RS232 converter), to personal computer communication port COM1.

Set CL526 in mA measurement (IN). Run the program and you will see on the computer screen the actual reading value (once).

Example B: (PC instructions to CL526)

Set IDNAME=1 and BAUD RATE=9600 on CL526 (see chapter 8.6). Connect CL526 through adapter BB530001 (TTL- RS232 converter), to personal computer communication port COM1.

Set the CL526 for current OUT mode; run the program and CL526 will be set automatically to 20mA.

Example A:

1Ø CHAR = Ø

2Ø IDNAME = 1

3Ø INSTRUCTION = 24

35 OPEN "COM1: 96ØØ, N,8,1,CD,CS,DS,RS" FOR RANDOM AS # 1

4Ø PRINT #1, CHR$ (IDNAME);:REM TRANSMIT IDNAME TO CL526

5Ø WHILE LOC (1) = Ø: WEND: REM WAIT RECEIVING IDNAME FROM CL526

6Ø IDNAME = ASC (INPUT$ (1, 1)): REM READ RECEIVED IDNAME FROM CL526 7Ø PRINT #1, CHR$ (INSTRUCTION);

8Ø WHILE LOC (1) = Ø: WEND

9Ø INSTRUCTION = ASC (INPUT$ (1, 1)) 1ØØ PRINT #1, CHR$ (CHAR);

11Ø WHILE LOC (1) = Ø: WEND

12Ø DATA 1 = ASC (INPUT$ (1, 1)) 13Ø PRINT #1, CHR$ (CHAR); 14Ø WHILE LOC (1) = Ø: WEND 15Ø DATA 2 = ASC (INPUT$ (1, 1)) 16Ø PRINT #1, CHR$ (CHAR); 17Ø WHILE LOC (1) = Ø: WEND 18Ø DATA 3 = ASC (INPUT$ (1, 1)) 19Ø PRINT #1, CHR$ (CHAR); 2ØØ WHILE LOC (1) = Ø: WEND 21Ø DATA 4 = ASC (INPUT$ (1, 1)) 22Ø PRINT #1, CHR$ (CHAR); 231Ø WHILE LOC (1) = Ø: WEND 24Ø CHKSUM = ASC (INPUT$ (1, 1))

25Ø IF CHKSUM <> ((DATA1 + DATA2 + DATA3 + DATA4) AND &HFF) THEN PRINT "Error": END 26Ø VALUE = DATA3 * 256 + DATA4

27Ø IF VALUE > 32767 THEN VALUE =VALUE - 65536: REM 2'S COMPLEMENT

28Ø PRINT "VALUE: " ; VALUE / 1ØØ 29Ø END

Example B:

1Ø CHAR = Ø

2Ø IDNAME = 1

3Ø INSTRUCTION = 27 4Ø VALUE = 2ØØØ

5Ø VALUE$ = HEX$ (VALUE)

55WHILE LEN (VALUE$)<4: VALUE$ ="Ø"+VALUE$: WEND 6Ø IF LEN (VALUE$) > 4 THEN VALUE$ =RIGHT$ (VALUE$,4)

65DATA1 = VAL ("&H" + LEFT$ (VALUE$, 2)) 7Ø DATA2 = VAL ("&H" +RIGHT$ (VALUE$, 2))

75DATA3 = Ø 8Ø DATA4 = Ø

9Ø CHKSUM = (DATA1 + DATA2 + DATA3 + DATA4) AND &H7F

1ØØ REM MEMORY RELEASE PREVIOUS 4.xx1 (Example 4.ØØØ, 4.2ØØ) MUST USE 11Ø REM NEXT LINE INSTEAD LINE 9Ø OR PROGRAM DOES'NT WORK

12Ø REM CHKSUM =(DATA1 + DATA2 + DATA3 + DATA4) AND &HFF 13Ø OPEN "COM1: 96ØØ,N,8,1,CD,CS,DS,RS" FOR RANDOM AS #1 14Ø PRINT #1, CHR$ (IDNAME) ; : REM TRANSMIT IDNAME TO CL526

15Ø WHILE LOC (1) = Ø: WEND: REM WAIT RECEIVING IDNAME FROM CL526

44

Image 44
Contents CL526 OMEGAnetSM On-Line Service Internet e-mail Info@omega.com Introductory Note Table of Contents Digital Interface General Performance Specifications Power supply Battery lifeBattery voltage Dimensions 120x60x230 mm Weights net 1 KgTable of ranges and accuracy 32 to +302F ± 0.02% of rdg +0.18FGeneral Features Case Physical Description + 5 V for logic and analog circuits 5 V for analog circuits Power supplyFunctional Description Input circuit Microprocessor FirmwareDigital display Digital to analog converterBattery charger. Operation from line source Resistance and Rtd measurementsResistance and Rtd simulation Thermocouples input-output circuitUnpacking PRE-OPERATIONAL Check Out 1248.3C TcWiring practice Electrical ConnectionsThermocouple wires Examples of input /output wiring and connectionsLimit of Error of thermocouple wires ClassPower Supply Battery ChargerHow to maximize the battery life Battery Line OpPower on Battery voltage indicationOperating mode set up Operation & ApplicationsOUT mode selection Parameter or sensor selection1032.2C TcK Out 0.0C TcKInternational Temperature Scale Rj modeTecnical unit Decimal point positionIN-OUT data memories Data memory configurationAverage readings Data memory manual recall Data memory automatic scanningSimulation cycle selection Manual step advanceAutomatic simulation cycle Time 0h 0m 50s Start 0.0mVEnd 100.0mV 0mVRj compensation mode check Simulation cycleMode Linear Mode Square Scale factor programRJ 0.0C ext ProgWord mbar Word psi Word hPaExternal Rj compensation Installation parameter procedureFirmware version code Serial number Digital interface data program mode Digital output wiring practiceDigital Interface Baud RateComputer CL526 TTL to RS 232 adapterCommunication protocol from CL526 to a PC Instruct DataPage Ramp Computer request for CL526 settings = OHMInstr ModeDis/Lin STO 2 #D 127 202 Display Chksum = DATA1 + DATA2 + Data 3 + Data 4 .AND.7F Communication programs Example a data transfer from CL526 to PCExample B PC instructions to CL526 Example a3ØØ While LOC 1 = Ø Wend Maintenance Safety recommendationsFaulty operating conditions Error ChecksumProtection fuses StorageIndex WARRANTY/DISCLAIMER Temperature