DATA4 VALUE (LL)
SIGNED LONG VALUE = ALARM HI
$85 - LAL Setpoint | TX | |
DATA1 | VALUE (HH) |
|
DATA2 | VALUE (H) |
|
DATA3 | VALUE (L) |
|
DATA4 | VALUE (LL) |
|
SIGNED LONG VALUE = ALARM LO |
|
$86 - Tag ID | TX | |
DATA1 | Tag ID (0=Tag0, 1=TagA, 2=TagB,.....,19=TagS) |
|
DATA2 | - |
|
DATA3 | - |
|
DATA4 | - |
|
$87 - Tag description | TX | |
DATA1 | Char position (0÷7) |
|
DATA2 | 'X' (ASCII CODE) |
|
DATA3 | - |
|
DATA4 | - |
|
15.3.3Communication programs
In this paragraph are illustrated two examples of communication programs between the OSP and an IBM or IBM compatible PC.
Example A:
Data transfer from OSP to PC
Connect OSP through adapter BB530001
Example B:
PC instructions to OSP
Connect OSP through adapter BB530001
Example A:
1Ø CHAR = Ø
2Ø IDNAME = 1
3Ø INSTRUCTION = 0
35 OPEN "COM1: 96ØØ, N,8,1,CD,CS,DS,RS" FOR RANDOM AS # 1
4Ø PRINT #1, CHR$ (IDNAME);:REM TRANSMIT IDNAME TO OSP
5Ø WHILE LOC (1) = Ø: WEND: REM WAIT RECEIVING IDNAME FROM OSP
6Ø IDNAME = ASC (INPUT$ (1, 1)): REM READ RECEIVED IDNAME FROM OSP 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
50