Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Advice controlling a projector with labview ( rs232 )

Hi there i have readed some guides and examples of how to read/write from rs232 in labview. My problem is that i have to control a projector with it, and i need to communicate with it in his own "protocol" i mean, for example this two commands:

- Requesting projector status (Get command)
 (1) Send the following request code from the PC to the projector.
 Header + Command data (‘02H’ + ‘00H’ + type (2 bytes) + ‘00H’ + ‘00H’)
 (2) The projector returns the response code ‘1DH’ + data (2 bytes) to the PC.
- Changing the projector settings (Set command)
 (1) Send the following setting code from the PC to the projector.
 Header + Command data (‘01H’ + ‘00H’ + type (2 bytes) + setting code (2 bytes))
 (2) The projector changes the setting based on the above setting code.
 (3) The projector returns the response code ‘06H’ to the PC.

So my real problem is making an application that can send and receive the data as it needs to be in his format when i choose for sample to use a get command and a set command for example. Any advice? Thanks in advance and btw sorry for my english.

0 Kudos
Message 1 of 3
(3,384 Views)

For a VISA Write input, you can use a string control set for hex display, a U8 array and the Byte Array to String, and other methods. You'll find many, many examples of hex and serial on the boards. Do a search.

0 Kudos
Message 2 of 3
(3,375 Views)

Hi, roundish,

 

you can send via 232 whatever commands you want so as to communicate with your device. The driver you must use is NI-VISA. Here you are a brief VISA tutorial and the manual reference guide:

 

http://zone.ni.com/devzone/cda/tut/p/id/3511

http://digital.ni.com/manuals.nsf/websearch/87E52268CF9ACCEE86256D0F006E860D

 

You can also start from LabVIEW examples. Go to LabVIEW >> Help >> Find Examples... (The Example Finder Window opens) >> Hardware Input and Output >> Serial. I recommend to you two of them: Basic Serial Write and Read.vi and Advanced Serial Write and Read.vi.

 

I hope this helps!

 

Saludos.

 

Jesús.

0 Kudos
Message 3 of 3
(3,356 Views)