06-17-2014 08:41 AM
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.
06-17-2014 09:59 AM
Make sure the buttons that don't work do not have a "latching" mechanical action assigned to them.
Mike...
06-17-2014 10:25 AM
If you are using the button change to trigger an event structure, use the value(signaling) property node
06-17-2014 10:39 AM
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.
06-17-2014 10:40 AM
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.
06-17-2014 10:46 AM
Can you post the VI - minus any extraneous subVIs?
Mike...
06-17-2014 11:17 AM
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
06-17-2014 11:17 AM
and here comes the measurement.vi
06-17-2014 11:35 AM
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.
06-17-2014 11:43 AM
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...