Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with VISA runtime 4.1

I am trying to communicate via RS232 through labview.  And I am getting bad data back.  And it only happens on this one computer, and only through labview.  I can use hyperterminal and I get the correct data back everytime.  And I have tried 2 different computers and tried them using the same labview app and they will give me the correct data also.  I thought it might be the serial port on the computers motherboard, so I tried a separate pci serial card and I am still getting the same thing. 
 
What happens is I should get a data string similar to this:
 
Target      Monitor     Strengths
123     456
213     654
784     985
 
 
And there are a bunch more.  What happens is Certain rows will come back in the wrong place.  For instance the 784 row could be where the 213 row should be.
 
Does anyone ahve any ideas what this could be? 
 
Thank you.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 1 of 4
(3,468 Views)
Hey Remenakb,
 
Something we could do to troubleshoot this issue is use NI-SPY. To start NI-Spy, just go to Start->Programs->National Instruments->NI-Spy. When you run NI-SPY, it will show all the commands being sent to the dll, and all the parameters being passed.
 
What I'd take a look into is for the command ibrd(message) and check that the message is coming in the correct order. I suspect that it's probably coming in the correct order. and it may be somewhere else in your program that the words are getting jumbled up.
 
The second thing I would recommend, is instead of writing to a file, just write to a single indicator, and analyze if some of the packets are coming as a group of two (You may be able to verify this in NI-SPY)
 
Can you let me know if these two strategies help?
 
Good luck,
 
Nick D.
0 Kudos
Message 2 of 4
(3,453 Views)
Hi
You should also post the program (if not too big) that yoou use.
It is easy to have a race condition in LabVIEW.
The same feature that makes parallel execution easy in LabVIEW can give you headaches with a race condition.
I know because I'm searching for one in one of my applications.

Are all IO routines connected by the error in/error out wire?
greetings from the Netherlands
0 Kudos
Message 3 of 4
(3,450 Views)

I found out my problem.  It ended up being hardware related.  The sheild of the cable was left floating, and wasnt grounded anywhere.  Once I made the ground connection it started to work.

 

Thanks for everyones help.

Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 4 of 4
(3,445 Views)