LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 8.6: programatically pressing button only works in some VIs, not all?

Setup is an old labview 8.6

I'm tasked with fixing some strange old engine test bench which has a ~1E-6 measurement drift.

The "easiest" work around fix would be to run the mechanics to a bottom end point then press the "reset" measurement button automatically.

!!:  A "drive" vi and a "measurement" vi has to be running at the same time. The drive vi will then periodically drive the test bench to a mechanical end point and reset the measurement vi. This would get rid of the drift.

!!:  Both vi's must be started manually and running. I cannot start one vi from the other. It messes things up. I know not why. There seems to be some strange dependency over compiled FPGA code somewhere.

 

I'm no lab view wizard. It was 20 years since I touched it last.

So digging through examples on how to press a button in one VI from another VI I found this:

https://decibel.ni.com/content/docs/DOC-15962

Which I built into a sub-vi and a test setup to see if I could make it work on the test bench. With some tweaking it works.

A test "master" vi can press any button in a test "slave" vi.

 

However. It is impossible to press the "reset" button in the "measurement" vi.

Labview reports no errors, it just doesn't execute the value change event as far as I can understand.

In fact, I can copy exactly the same code from the working "slave" vi into the "measurement" vi and it stops working. !!??

 

How can code work perfectly well in one vi but not in another ?

 

The "measurement" vi has some sort of compilation requirements, meaning any change to the vi takes >30min to "compile" before it can be run. Can this have something to do with why remote button pressing doesn't work?

It also interfaces with some FPGA somewhere, can that have something to do with it ?

 

I have no clue. Happy for any help here.

0 Kudos
Message 1 of 13
(2,562 Views)

Make sure the buttons that don't work do not have a "latching" mechanical action assigned to them.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 13
(2,530 Views)

If you are using the button change to trigger an event structure, use the value(signaling) property node

0 Kudos
Message 3 of 13
(2,526 Views)

Thanks mikeporter. I found that out earlier and fixed it. Took me a while to figure out what the mechanism stuff meant.

The target button works perfectly in the test "slave" vi, but the same code doesn't work at all in the "measurement" vi. No button, regarding of setting can be pressed by remote in that vi.

0 Kudos
Message 4 of 13
(2,519 Views)

Thanks pjr1121. Yep, the remote pushing action is done by a value(signaling) property node.

Works great in the test vi but not in the "measurement" vi. Even the same code copied stops working in the measurement vi.

0 Kudos
Message 5 of 13
(2,517 Views)

Can you post the VI - minus any extraneous subVIs?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 13
(2,513 Views)

Here it comes -- WARNING -- ugly code, this is my first labview in 20 years and I'm very short on time.

 

press-button.vi

  the sub vi I mangle up from the example (https://decibel.ni.com/content/docs/DOC-15962)

 

master.vi

  the test event sender

 

slave.vi

  the test event receiver

 

measurement.vi

  the real vi, where no buttons can be pressed

 

In master.vi you can reconfigure the input to press-button to which vi and button to target. Right now it is set for the test slave vi (I think) to verify that it actually works as intended in the test environment.

 

Hmm, seems there is a limit to 3 attachments, will post the measurement.vi in next post

Download All
0 Kudos
Message 7 of 13
(2,508 Views)

and here comes the measurement.vi

0 Kudos
Message 8 of 13
(2,505 Views)

This code runs on an FPGA.  That is why this doesn't work.  There are no events in an FPGA.  And I'm pretty sure you can't even get a reference to a control in FPGA either.

 

I would recommend just making a global variable that you can toggle.


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 9 of 13
(2,500 Views)

Thanks a bunch crossrulz. I suspected it might be something like that.

The press-button call executes without any errors, it just has no effect.

 

I'll see if I can make your suggestion work...

0 Kudos
Message 10 of 13
(2,497 Views)