The RS232C interface cannot receive an SRQ interrupt.
Sending Commands
This example shows how to send a command.
OPEN "COM2:9600,N,8,1" FOR RANDOM AS #3
A = 10
PRINT#3, "SWITCH 1 1 1 ";A
END
Querying Status
This example queries and displays the current channel setting.
PRINT#3, "SWITCH?"
INPUT#3, A
PRINT A
END
Reading the Status Register
The serial polling function is not supported on any RS232C interface, but STB? can be used to
query the status register because the query command performs the same function as serial
polling.
The following example changes the channel setting and reads the status register continuously
until the output is settled.
OPEN "COM2:9600,N,8,1" FOR RANDOM AS #3
PRINT#3, "CSB"
PRINT#3, "SWITCH 1 1 2"
DO
PRINT#3, "STB?"
INPUT#3, SR1
LOOP UNTIL (SR1 AND 4)
PRINT SR1
END
' clear status register
' loop until motor settles
Programming Guide – 34