LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird VISA related problem

Solved!
Go to solution

@GerdW wrote:

Hi MaSta,

 


@MaSta wrote:

A PNG can contain LV code? I doubt that. But I found it now. Never noticed


Many image formats can contain arbitrary information! And LabVIEW code is just another kind of "arbitrary information"…

 

Did you ever wonder how digital cameras store information like exposure settings inside of JPG images?


Actually that is fairly standardized with so called EXIF tags.

Rolf Kalbermatter
My Blog
Message 11 of 29
(751 Views)

Back to the topic. Anybody watched the video and has some explanation?

0 Kudos
Message 12 of 29
(734 Views)

Hi MaSta,

 


@MaSta wrote:

Back to the topic. Anybody watched the video and has some explanation?


Can you verify your device actually receives the command?

(To make sure the problem is in the VISAWrite or VISARead command! Right now you only detect a timeout at the VISARead, but that might occur because the VISAWrite does not work as expected…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 29
(722 Views)

@GerdW: No. I have to rely on VISA actually sending it. Tracing it only shows (1st attempt, 1 fail):

MaSta_0-1669380665476.png

while the 2nd attempt was good:

MaSta_1-1669380728633.png

 

0 Kudos
Message 14 of 29
(708 Views)

Many drivers do not do well if you are constantly opening and closing the port.  If you leave the port open, can you perform your 15ms rate without errors?  This would require using a loop around your main part of the code (leave the Configure Serial Port and VISA Close out of the loop).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 15 of 29
(657 Views)

@crossrulz wrote:

Many drivers do not do well if you are constantly opening and closing the port.  If you leave the port open, can you perform your 15ms rate without errors?  This would require using a loop around your main part of the code (leave the Configure Serial Port and VISA Close out of the loop).


Did you look at my VI? It is exactly done this way. The port is only opened once per run. Running the VI in auto-repeat doesn't show the problem or at least not that often.

 

0 Kudos
Message 16 of 29
(634 Views)

This sounds like an issue closer to the hardware. Can you verify the response timing by other means, e.g. an oscilloscope (for a real line) or wireshark (for a virtual port)? It sounds like the first iteration is the one that is mostly affected, so I guess that the device needs some time to "warm up". Do you have access to the firmware?

Message 17 of 29
(619 Views)

@LLindenbauer: Thanks for your intention to help, but I explained this several times now:

- it doesn't occur outside of LV and VISA

- the response time of the device isn't the problem, as shown in the video -> it's fairly stable when doing the same in our C# software

 

Regarding the first iteration: no, as the query is in the 3rd iteration. 

 

From the I/O Trace log I see that VISA claims to have have transported the query and then waits for the answer. Not getting it and running into a timeout can only mean, the device has either not responded at all (disproved by the counter check with EAPC), it hasn't sent the termination character (not disproved yet, but easily to do if needed) or VISA has not reacted to the data coming in or is accessing the driver in a wrong way. 

 

I think I will contact the NI support. Let's see what they have to say...

0 Kudos
Message 18 of 29
(601 Views)

You can insist that it is a bug in VISA or whatever and refuse to consider further tests as suggested by members and point at your VI and video and say they contain all conclusive proof that it is not something you should have to bother about yourself but someone else (such as the volunteers on this board). However it is your project and your device you try to talk to, and hence your debugging effort that will determine if you get this working or not.

 

Just because it happens when using VISA and not when using your own COMM API (apparently, all we have is your word for it), doesn't mean that VISA is at fault. Just maybe that it doesn't do or leave out certain things automagically but that you have to set or clear some attribute explicitly. But if you refuse to do your own testing and debugging and simply just keep pointing at your posted VI and video and hope that someone magically has an Eureka moment from that, your VI is probably never gonna work as intended.

Rolf Kalbermatter
My Blog
0 Kudos
Message 19 of 29
(584 Views)

I didn't refuse anything, I just did all what was suggested and what I could do. Most of the suggested actions were already done before they were suggested.

Furthermore, nobody said it's a bug. Could also be using VISA the wrong way.

 

It's still weird, but it seems to have disappeared. The only thing I changed yesterday, according to GerdW's suggestion, is to replace the VISA Open VI by the Configure Serial VI to set the timeout to 200 ms. Nothing else. No read timeouts anymore so far.

0 Kudos
Message 20 of 29
(566 Views)