04-16-2009 03:47 PM
Dear sir,
I am writing a driver controller of the SQUID in LabView, since the driver in LabView is not available on NI website,
neither on the manufacturer's website. The interface is serial RS-232 communication, and I also got the serial
communication protocol from the manufacturer. Now the problem I have is:
1. Do I use VISA OPEN.vi, VISA WRITE.vi, VISA READ.vi, and VISA CLOSE.vi, to communicate with the instrument?
2. How do I know the address of the instrument?
3. The communication between the SQUID and the computer, the serial communication protocol uses binary data,
which is packed into a special data frame: byte 1 (address) ->byte 2 (command+parameters)->byte 3 (8 bit binary
data Hi)->byte 4 (8 bit binary data Low). Do I write to the VISA WRITE.vi the communication protocol one byte by one
byte? Or I can write the whole four Bytes of the data frame at once?. Do I write it in binary or hex?
Thank you very much for your great assistance and precious answers.
Margaret
04-17-2009 05:09 AM
Please look at the basic serial example.
1) VISA is the bestinterface to build on.
use open when starting to talk to the instrument, read and write during the talk and close just before the program finishes
2) You don't need an address because a serial line normally is a point to point connection. In some cases an instrument needs an address but then this should be documented by the manufacturer (e.g. when the first instrument can have an extra instrument connected via a next serial line from the first to the second instrument)
3) you need a low level vi that translates the command in a series of bytes to send and a vi to interprete the received commands
hex or binary is just like decimal a way to view the bytes, the bits inside a byte are the same.
And visa can write a string of almost any length. (I did not try beyond 1G but I'm sure there is a limit somewhere)