LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic VISA/TCPIP problem

Solved!
Go to solution

good news!!!
I managed to communicate with my device and make it broadcast, there is only one problem I do not understand that you might be able to help me overcome. (The problem appears in the picture)

0 Kudos
Message 11 of 26
(1,934 Views)

@Matanlaza wrote:

good news!!!
I managed to communicate with my device and make it broadcast, there is only one problem I do not understand that you might be able to help me overcome. (The problem appears in the picture)


You should save your VI with your default settings, and upload your very VI and not a screenshot here! It is much easier to debug your code if we can work on the actual VI!

There are several issues with your latest code version:

  1. You should not initialize and close the VISA resource at EVERY while loop iteration! Init VISA BEFORE the loop, and close it AFTER the loop!
  2. You should put some delay into the While loop, you might not giving "enough time" for the device to recover between different operations...
  3. I would put a Boolean control with a Case structure, not to trigger the same actions several times, and also to avoid partial/wrong commands to be sent to the device.
  4. You specify your command wrong! You used the "OUTP 1;" but you need a colon ":" before every command (RTFM! 😉 😞
    :OUTP ON
  5. You only need to use the ";" semicolon, if you send multiple commands, so you need to separate them!

 

Try something like the following...

If you have any more problem with your VI, you should attach your VI here, or create a snippet and post that one...

 

VISA_test1.png

0 Kudos
Message 12 of 26
(1,924 Views)

thanks a lot, I will try it and hope for good!

0 Kudos
Message 13 of 26
(1,913 Views)

There is a small mistake in the attached VI/snippet: forgot to connect the "OK Button" control to the Case structure's selector terminal, but I guess you found the problem...

0 Kudos
Message 14 of 26
(1,909 Views)

Thank you very much for the comments, it is very helpful!

As you saw, I am at the beginning of my way and your comments advanced me towards the goal.

I'll try to fix some things in the software and if I get stuck I'll upload the VI and not a picture 🙂

0 Kudos
Message 15 of 26
(1,893 Views)

Good luck, and have fun learning LabVIEW! 🙂

0 Kudos
Message 16 of 26
(1,892 Views)

Hey again,

I'm coming back to you faster than I thought 😄

the program is working great but there is still the same problem with the message shown in the pictures, do you know what it means?

another issue, I understand the block diagram of the VISA but there is one block that I did not understand so much what its importance - "property node" - the block before the while loop.

thanks and have a great day 🙂

 

Download All
0 Kudos
Message 17 of 26
(1,887 Views)

You did not really make the same VI as I showed you before. 

I see you try to program an output enable/disable feature with that Case structure. The problem with the recent version of your VI is that, you repeatedly execute one of the ON or OFF commands. This is not a desirable design. You could use an Event Structure, which gives more flexibility, but I would not make that big step since you are a beginner.

 

So I advise you to experiment with my original VI! Where you use the Latching "OK Button", to execute only ONCE when you click on the button, and not repeatedly commands! Regarding to your question, that property node just sets a certain timeout. You can try to increase it to 10 sec (10000 msec), as I remember that was the used value in the official driver. And the error msg means exactly what it says: a timeout error. It means that, the VISA Read did not read data back from the instrument. This can be due to several things, I am not sure yet.

 

So please test the unit with my VI, and see if there is any error with it?

0 Kudos
Message 18 of 26
(1,883 Views)

Ok, you have to read the pdf programming manual a bit more. The reason of the timeout error is that, the device does not reply with data for the 

":OUTP On/OFF"

commands. You need to query a status response with the

 ":OUTP?"

command! See my attached VI for testing! And please use this very VI and not a modified one, before showing error msgs! 🙂

 

VISA_test2.png

 

 

0 Kudos
Message 19 of 26
(1,878 Views)

thanks again! I'm beginning to understand things and of course, there are things I need to improve on

I checked and it works, however, after it performs the action the error pops up again as before. 😞 

I just want to understand how to fix this mistake and from there I believe that I will manage on my own, hopefully 😄

 

0 Kudos
Message 20 of 26
(1,871 Views)