05-31-2022 08:09 AM - edited 05-31-2022 08:49 AM
Hello, i'm trying to make a vi with simple functions to start learning how visa write/read works. Im trying to use this vi with a Keysight 34461A dmm. When i run it, the initialization case goes fine but the code stops at the write in the DC measurement case. Can someone explain what am i doing wrong and how can i fix it? Thank you
EDIT: i removed all the visa read functions and now the program runs from start to finish, but it still doesnt change the values shown on the multimeters.
05-31-2022 12:47 PM
Hi domcorrado,
@domcorrado wrote:
Hello, i'm trying to make a vi with simple functions to start learning how visa write/read works. Im trying to use this vi with a Keysight 34461A dmm. When i run it, the initialization case goes fine but the code stops at the write in the DC measurement case. Can someone explain what am i doing wrong and how can i fix it?
Does it really stop while executing the VISAWrite function? (This would be very uncommon…)
Why do you wire the "bytes written" output of the VISAWrite to the "bytes to read" of the following VISARead function? How are both related?
Do you really want to place all this functionality into just one ActionEngine? This is a very unusual approach to define a device driver with a nice API. Did you take a look at other device drivers found at www.ni.com/idnet ?
05-31-2022 03:57 PM
Yeah, I have to agree with GerdW here, trying to make this an all inclusive Action Engine is not a good idea to begin with...
I know when you are first starting out it seems like a good idea to just have one VI that does everything, but generally it's not.
With most instruments you really need to follow these basic steps
Don't try to do all this in one Action Engine VI
06-01-2022 01:12 AM
Hello GerdW,
yes I know that it’s not the optimal way to do this but my teacher is making me doing it this way and then insert multiple of this vi as subvis in another “test” vi just to show us how it works.
about the bytes written/read functions: it just seemed the right thing to do to me since this way the read function is gonna read exactly the amount of bytes I write. Does it not work this way? Either way as I said, if I remove the all the visa reads, the vi works but it doesn’t really change the values on the multimeter as I want.
06-01-2022 03:20 AM - edited 06-01-2022 03:23 AM
Hi domcorrado,
@domcorrado wrote:
about the bytes written/read functions: it just seemed the right thing to do to me since this way the read function is gonna read exactly the amount of bytes I write. Does it not work this way?
Well, let's go through an arbitrary example:
Do you still think it "works this way"?
At VISARead you need to request atleast the number of bytes that you expect from your device. Read the manual of your device to know how many chars to expect. (In general when you use a TermChar for communication then you should request a much larger number of bytes like "999" as the VISARead will automatically stop to read at the TermChar…)
06-01-2022 07:52 AM
@GerdW wrote:
Hi domcorrado,
@domcorrado wrote:
about the bytes written/read functions: it just seemed the right thing to do to me since this way the read function is gonna read exactly the amount of bytes I write. Does it not work this way?
Well, let's go through an arbitrary example:
- VISAWrite("Read?") will write 5 chars to your device.
- The device might answer with "1.23456e1 V" (which are 11 chars), but with your method you only read the first 5 chars…
Do you still think it "works this way"?
At VISARead you need to request atleast the number of bytes that you expect from your device. Read the manual of your device to know how many chars to expect. (In general when you use a TermChar for communication then you should request a much larger number of bytes like "999" as the VISARead will automatically stop to read at the TermChar…)
Just to be clear, "999" is not a magic number or a limit of some sort; you may use "1000" if you want to. 😄
06-03-2022 06:03 AM
Hello, I’m back after a while and I tried using yor advice for bytes. The code still goes in timeout, I also tried to use the “bytes at source” visa property node but it gives me error. At this point I don’t know what to do
06-03-2022 09:38 AM - edited 06-03-2022 09:47 AM
@domcorrado wrote:
Hello, I’m back after a while and I tried using yor advice for bytes. The code still goes in timeout, I also tried to use the “bytes at source” visa property node but it gives me error. At this point I don’t know what to do
Do you see anything wrong here?
"CONF:CURR:DC\s1,0.001TRIG:SOUR\sEXT;SLOP\sPOSINITFETC?\s0.000000\s" Because I know how SCPI commands are formatted and can read the language I can state the query TRIGger:SLOPe POSINITFETCH? will result in a system error on the device. comma delimited parameters are also illegal and 0.000000 is meaningless.
And!!! you did not wire "Value In": to the connector pane! so how would you change Value?
There are all kinds of "Wrong Things" in the other cases too.
You can actually SEARCH the Instrument Driver Network right from any LabVIEW panel by launching the driver wizard Menu..Help>>Find Instrument Driver...It will take you right here