ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with instrument to control

Garfield wrote:
>
> hello!
>
> I am a new user for LabView, and I met a problem with
> interface for RS232 instrument to build.
>
> It is for ventils to control ( ventil runs just as a small air pump), I
want
> to
> do it by LabView programm.
>
> it runs by:
> 9600 bau rate,
> 8 data bits,
> 1 stop bit,
> no parity.
> 4 chanals.(it can control max. 4 ventils)
>
> I set them up by the first step.
>
> And then I wanted to give a command to test it. I got the information
> from its manual: (open one ventil)
>
> Byte1 Byte 2 Byte 3 Byte4
> 10010000 0000CCCC 00000nnn 0nnnnnnn
>
> CCCC: the number of chanal (it is chanal 1 that i would test).
> nnn nnnnnn (10bits in Byte3 and 4)) :
the value of the pump (in %, i
wanted
> 100%).
>
> So by the second step I wrote the string
> "10010000 00000001 00000111 01111111"

Hi!

with the suggestions from you I tried to control it with VISA I/O VIs, I
wrote it
just as the example in the manual, but there is still the same problem.

I wrote the command as a hex. number(90 01 7 7F) in a array and changed it
into a string
,then inputed it directly to the Buffertowrite by the sub-vi VISAWrite, I
always feel it is not
very correct, but I don't know how to do it. could someone help me to find
the mistakes I made ? Thanks a lot!


Le

P.S: where can I find the software to test the COM, for example to check how
the pins
work?
0 Kudos
Message 1 of 2
(2,557 Views)
It sounds as if you might be sending the wrong bytes, or too many of them, to your instrument. A simple way to check this is to put a string indicator right next to the the Buffertowrite input and connect your outoing string wire to it. Right-click on the indicator and select "'\' Codes Display". When you run the VI, you should see "\90\01\07\7F" in that indicator.

If you don't see that value, you're doing something wrong in the string creation. Check the following thread to see how to use "Byte Array to String" to form your output string from a U8 array:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=50650000000800000075130000&ECategory=LabVIEW.LabVIEW+General

If you do see that value, then you're right about checking the communic
ation with your instrument. See the following Developer Zone document for help with the COM port:

http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&93FD9F2AD3D0641E8625682100067F39&cat=1485C1F3A7F1EF8D862567EC00577686

Regards,
John Lum
National Instruments
0 Kudos
Message 2 of 2
(2,557 Views)