LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Driver problems Visa

Hi,

I have problems to communicate with a Rigol DL3021

If I use NI Max to send some message to the DL3021 then it works fine

If I use first my labview test program then it doesn`t work

So I think it should some parameters that have to be insert so that I can use the VISA driver

 

Any infos can help

 

SLZ1970_0-1676985178201.png

 

0 Kudos
Message 1 of 16
(1,744 Views)

Hi SLZ,

 


@SLZ1970 wrote:

I have problems to communicate with a Rigol DL3021

If I use NI Max to send some message to the DL3021 then it works fine

If I use first my labview test program then it doesn`t work

So I think it should some parameters that have to be insert so that I can use the VISA driver


Do you send EXACTLY the same command to your device as you do in MAX testpanel?

("EXACTLY" includes the very same and correct termination char!)

 

Btw. we cannot edit/run/debug images with LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(1,722 Views)

Looking at a picture of code is not as helpful as looking at code (an attached VI, for example, or a LabVIEW Snippet).

 

How have you configured VISA?  Baud rate?  Parity?  Have you tried the Serial sub-Palette of the Instrument I/O Palette, rather than the VISA sub-Palette?

 

Bob Schor

0 Kudos
Message 3 of 16
(1,716 Views)

Hi,

yes, I used the same end character

Also I tried to use hte same parameters but not sure that all the same like NI max

 

After I have send a message with NI max succesful then it is also possible with my program to send and to get the correct answer

 

I tried to configure the parameter like the same that I found in NI Max but nothing change

0 Kudos
Message 4 of 16
(1,709 Views)

1. What communication bus are you using (Serial, Ethernet, GPIB)?

2. Are you really sure you are sending the termination character, typically a Carriage Return and/or Line Feed?  Unless you expressly add it to your input string, you are not sending it.  I tend to cancatenate the End Of Line character in my driver so I don't have to worry about it at the application level.


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
0 Kudos
Message 5 of 16
(1,670 Views)

1. The communication is via USB

2. Yes, i send the End Character, I send *IDN?;

 

I realised that every second sending works fine 

0 Kudos
Message 6 of 16
(1,651 Views)

@SLZ1970 wrote:

1. The communication is via USB

2. Yes, i send the End Character, I send *IDN?;


Most likely you are not! The Programmer Manual for the DL3000 series has examples for various programming languages (including LabVIEW) at the end and they all send: *IDN?\n

 

Note that the \n is an escaped <new line> character. You need in LabVIEW to right click the control or constant and select '\' Display Mode to enter this like that. In normal display mode you would send the \ and n character as separate bytes instead of the '\n' new line character.

 

MAX works, because it appends by default a "\r\n" at the end, and while this is to much for this device, the important part is that there is a "\n". The "\r" is simply discarded by the device as uninteresting character.

 

Theoretically the semicolon should work too as termination element if the device was truly SCPI compliant, but I guess the Rigol firmware takes a few shortcuts in that regard.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 16
(1,636 Views)

@rolfk wrote:

Theoretically the semicolon should work too as termination element if the device was truly SCPI compliant, but I guess the Rigol firmware takes a few shortcuts in that regard.


I find most instruments need that Line Feed character to know when a message has ended.  Messages will just sit in the buffer until that Line Feed has been read and then it gets passed on to the actual application.  I have noticed this especially on serial and Ethernet busses.  Not so much with GPIB because the bus protocol actually has a signal (hard wire signal) stating when a message is done.  I try to avoid USB communications.

 

I have not dug through the SCPI standard enough to see if a simicolon is a valid message termination.  My understanding is that it is meant to separate commands in a single message.


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
0 Kudos
Message 8 of 16
(1,621 Views)

@crossrulz wrote:

I have not dug through the SCPI standard enough to see if a simicolon is a valid message termination.  My understanding is that it is meant to separate commands in a single message.


It's indeed used for that. And it SHOULD indicate to the command parser to evaluate the command string now. You can daisy chain commands in a single write through that and the different commands are normally guaranteed to be evaluated and have caused any related state changes at the time the processor starts evaluating the next command.

 

But only Tektronix and HP/Agilent/Keysight (and to some extend Audio Precision) devices seem to honor this properly. And maybe they have stopped with that in the meantime too.

 

And there certainly is room for interface dependant behaviour. It doesn't surprise me at all if a device does operate differently over GPIB than over Ethernet for instance. It makes not much sense but the related parts were probably often programmed by very different people.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 16
(1,611 Views)

OK, I have changed this an nothing changed

 

I insert now \n as End Charachter by using '\'-Code ... 

Right click on the text and then choose '\'-Code... instant of normal

But also the same, it works only if I start NI Max before

And after I have started NI Max and send some message then it will also work without this \n

In booth in NI Max and in my program

 

So nothing changed

 

0 Kudos
Message 10 of 16
(1,566 Views)