Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

equivalent VISA settings?

I'm trying in vain to properly interface with an RS-232 instrument. I have the documentation for the serial commands, but can't get it working properly. The sending of data doesn't seem to work at all. I can get legible data from the instrument, but it seems to be ignoring any specific commands I send.....

The following is performed by the software delivered with the instrument (protocolled using Portmon)...

IOCTL_SERIAL_SET_WAIT_MASK Serial1 Mask: RXFLAG
IOCTL_SERIAL_SET_BAUD_RATE Serial1 Rate: 19200
IOCTL_SERIAL_SET_RTS Serial1
IOCTL_SERIAL_SET_DTR Serial1
IOCTL_SERIAL_SET_LINE_CONTROL Serial1 StopBits: 1 Parity: NONE WordLength: 8
IOCTL_SERIAL_SET_CHAR Serial1 EOF:d ERR:0 BRK:0 EVT:a XON:11 XOFF:13
IOCTL_SERIAL_SET
_HANDFLOW Serial1 Shake:1 Replace:43 XonLimit:1024 XoffLimit:1024
IOCTL_SERIAL_SET_QUEUE_SIZE Serial1 InSize: 4096 OutSize: 2048
IOCTL_SERIAL_WAIT_ON_MASK Serial1

I can't get the EOF, EVT, Xonlimit and Xofflimit values to match these. Perhaps my problem with communication has to do with this difference? Is there a similar function to WAIT_ON_MASK within VISA?

Can I call the windows Serial commands, and execute IOCTL commands from within LabVIEW? Or better still, are there equivalent VISA commands I haven't found yet?

Thanks

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 1 of 3
(3,042 Views)
I suspect that the problem is in how you are formatting the data you are sending to the instrument though anything is possible when it comes to serial comm. Have you attempted to send the commands with Hyperterminal or another terminal emulation program? Is there a termination character required? If yes, how are you sending it? Are there any other control characters required? Attaching an example of your program and even the instrument documentation would help.
0 Kudos
Message 2 of 3
(3,042 Views)
Thanks for the answer Dennis,

I've got it working, but don't ask me why.

I've changed the stop bit settings from 1 bit (described in the instrument manual) to 2 bits and Voila, it works. By capturing the communication using Portmon, it still seems different (Stop bit parameter shows "Error"), but the main thing is that the communication works.

I've also done some more reading on RXFlag and others, and I'm beginning to suspect that VISA handles all of this itself, thus removing the neccessity (Ability?) to manage this myself. The original software also seems to be working with Events (I presume RXFlag is set upon data receipt), which I don't seem to be able to find or implement in VISA. Again, I reckon this is controlled already by VISA (Or e
ven Windows...).

If anyone has any further information which might help me understand this, I'd be very happy. In the meantime, the problem is solved, and I'm working away on the program.

Greets.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 3
(3,042 Views)