LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What problem with comunication?

I'm using labview to communicate with hardware via RS232! But sometime, i can't received any data from hardware.Sometime it worked very well.
 But with other software(  not labview, suport from hardware's company) it works perfect, I alway can communicate with hardware!
When i got problem, i re-install labview, VISA, then it's work.....what is the problem?
0 Kudos
Message 1 of 12
(3,743 Views)

Are you closing and opening the session correctly all the time.  This sometimes locks up when you try to open a refernce that is already open etc.

Craig 

LabVIEW 2012
0 Kudos
Message 2 of 12
(3,735 Views)
hi! I'm using the example in labview: "Basic Serial Write and Read.vi ". So i think there isn't any mistake with that vi. But I still got that problem!
0 Kudos
Message 3 of 12
(3,725 Views)

Hi,

Will need a some more information to assist you further, What hardware is it?  What serial parameters does it use, flow control etc?  Have you modified the example "Serial Basic read and write.vi"?  is there an error associated before it locks up?

Craig

LabVIEW 2012
0 Kudos
Message 4 of 12
(3,709 Views)
The hardware is sensors. It's not difficult to communicate with computer! The commands are simple! I tried with the basic "Basic Serial Write and Read.vi ". sometime it's work good, but sometime i can't not communicate! I didn't change anythings!
I used NI spy see the communication! I attach the picture, maybe you get some solutions for me! Thanks
0 Kudos
Message 5 of 12
(3,690 Views)
I upload new picture! I hope it's better than prevouis pic!
0 Kudos
Message 6 of 12
(3,683 Views)
I test with Hyper Terminal, it works correctly!
0 Kudos
Message 7 of 12
(3,669 Views)
Just a thought - could it be connected with termination characters?
For example, when you type Enter in a Labvew string control you get a line feed character, so I think that is what the basic serial I/O vi will be sending out to your instrument, but perhaps your instrument is expecting a carriage return or CR/LF pair?
 
0 Kudos
Message 8 of 12
(3,667 Views)
Hi,
From the NI Spy log, it looks like when it fails there are no bytes at the serial port when you get a fail.  This suggests that the write command is not being sent properly, or the hardware has not replied.  Since it sounds like the hardware works correctly with hyper terminal it looks like a comms setup problem.  As suggested, have you ensured you are sending the correct Termination characters?  Is the parity / Flow control setup as dictated by the hardware?  Without looking at your vi and knowing what the hardware requires it is a little tricky to pin down the problem.  Serial control can be very picky when it wants to be.
Craig
LabVIEW 2012
0 Kudos
Message 9 of 12
(3,647 Views)
I tried to test something, but i still can not find the problem!
 
In Hyper terminal, i typed any commands ( you can see in the picture), i always got respones from hardware!
But i tried with labview, sometime it worked, sometime did not work.
 
Some one can explain for me the different between " VISA Write ("COM3", "MOIST?0..") "  and "" VISA Write ("COM3", "MOIST?0") ". If after the command ( in NI spy ) , there are" .. " , I always gets the communication,.

0 Kudos
Message 10 of 12
(3,625 Views)