From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling two machine in on VI

Hello everyone,

I have two instruments. One is autowave and another VDS. I need to controll them from same vi. Is it possible?

Here is what i want to do:

1) at first set initilize autowave

2) initilize VDS

3)Send wave form from Autowave.

 

I put these three cases in a state machine. They work as expected. But problem it is stuck in the third case. AS a result, I get the error below. "Object reference is not valid". I think my state machine doesn't reach to the third state. It could be because i am using the same instrument in State on and three.

 

fazlay42_0-1634215283324.png

 

I don't how to use Autowave then VDS and then go back to autowave to do the 3rd task.  

Thanks in advance for any clues.

0 Kudos
Message 1 of 11
(1,058 Views)

Care to share your code so we can see what you are doing and likely spot your mistake.


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 2 of 11
(1,047 Views)

Hello Crossrulz,

 

Yes sure, i am very new to labview, so I am using the drivers in the first folder. Second one has the State machine VI. I belive since autowave will send wave files to VDS, it needs to initiated first and then we get VDS ready through the DE commands. After that it needs to recieve the wave files from autowave.

 

Best Regards

Download All
0 Kudos
Message 3 of 11
(1,033 Views)

You are trying to use two different sources for the VISA resource for the Autowave.  I highly recommend you use a Shift Register to hold each of your VISA references.  This will eliminate some of the confusion of duplicate controls.  But you will need to be sure to wire up the output tunnels in all of your cases.  Luckily, there is a great feature called "Linked Tunnels" that you can use to do this for you.  Right-click on the output tunnel and you will see options for linking the output tunnel to an input tunnel.


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 4 of 11
(1,029 Views)

Hello crossrulz,

 

Sorry, I am a little confused. I put instrument controls outside of while loop. That gives shift register. after that i did what you said. A white dot apears in all the tunnels in the case structure. Am i getting you right?

 

0 Kudos
Message 5 of 11
(1,024 Views)

@fazlay42 wrote:

A white dot apears in all the tunnels in the case structure.


It is the little arrow on the tunnel that shows they are linked.  But your output tunnel also have the "Use Default If Unwired" enabled.  Disable that (right-click menu).  Now you need to wire the reference through all of the unwired cases (since you didn't use the Create & Wire option that was available).  The Linked Tunnels will automatically wire up any new cases you may introduce.


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 6 of 11
(1,021 Views)

HI Crossrulz,

I just want Case one and three to be connected. Is it possible? is not going to be a problem, If I wire the reference through all the all of the unwired cases. The case two does not have anything to do with autowave.

 

0 Kudos
Message 7 of 11
(1,019 Views)

The Linked Tunnels is just a tool to automatically wire a value through new cases.  You can delete that wire and do something else.


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 11
(1,001 Views)

Hello,

Now I am getting this error from the 2nd case. Is this a Labview error or is it a Visa error. Any idea what it means?

Error Code : -1073807339

Best Regards

0 Kudos
Message 9 of 11
(966 Views)

Help->Explain Error

 

It is a VISA error: "Timeout expired before operation completed."  In other words, you are not receiving data.


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 10 of 11
(957 Views)