03-04-2009 05:07 AM
Hi all,
I'm working on interfacing with an EEG measurement device called trackit via RS232. Right now, the goal is to merely send a command and receive a message saying that the device is available and the connection is okay (trackit calls this as heartbeat). Please see the attached Word documentation as part of strip down version of the whole manual. I've written a simple VISA write and read to interface with the device but to no avail. The VI either writes character by character to the serial port with 2 ms delay in between or send all characters at once - I honestly am not sure whether it makes any difference or not. You can refer to 3.2.1 as to the command I used to send to the device. In hex it is 1c00 0068 0d. I can't seem to figure out what is 1c in normal character (the manual refers this as FS. What is FS? Free space? Full stop?) Apart from '1c', the rest of the commands in normal character is 00h(CR), which (CR) refers to carriage return.
I think I've followed everything as in the manual (ie. command in hex, max character not more than 7 bit, baud rate, etc.). I hope someone can point out where I did wrong. I hope to hear back from you guys soon.
Thanks!
03-04-2009 08:36 AM
Do you get anything with the VISA Read? According to the doc you posted, you should get either an ACK or NACK so even if you sent a wrong command, something is supposed to come back. If you get nothing, could be that you are using the incorrect type of serial cable. I don't see anything that specifie whether you should be using a null modem or straight through cable.
A few minor comments about your code. You should use the VISA Bytes at Serial Port to determine how many bytes to read. That's probably not important until you can get something at all. Also, when you get to the point of constantly reading the instrument, the VISA Initialize Serial Port and the VISA Close would need to be placed in the top level VI so that each is only called once.
If the instrument comes with some software from the vendor, you should run that to see if it works. If that wors, you could use a program like portmon to capture the data and compare it to what you are sending.