Jeremy,
thanks for the confirmation with respect to the greyed out terminal. I
had to find out the meaning of "being right on the money about
something", so thanks for extending my knowledge of the English
language too ... 8-)
Please find the LabVIEW code in attachment. It uses a HP836xx LabVIEW
instrument driver (controlling an RF source) and also calls a C API to
have work done in Mathematica (www.wolfram.com) using MathLink. We
know that the functions which communicate with Mathematica are not
thread safe, so all function calls are set to "Run in UI Thread".
If you look at the block diagram, you find the return value of
LSNAgetEquiTimeStamps() connected to both the greyed out input
terminals of both LSNAgetTimeData().
The VI runs fine, setting the source and collecting data, until I
change the "Power(dBm)" control value. After a few changes, the C API
indicates that the packages which are exchanged with Mathematica are
"out of sequence". The same happens immediately if I indicate that the
functions are thread-safe, by specifying them to be re-entrant. So I
tend to conclude that one way or another the 2nd LSNAgetTimeData() is
executed before the 1st one has finished.
If I eliminate the wire connecting the return value of
LSNAsetEquiTimeStamps() to the lower LSNAgetTimeDat () input terminal
and connect the return value of the upper LSNAgetTimeData() to the
greyed out input terminal of the lower LSNAgetTimeData(), everything
works fine. I can change the value of the "Power(dBm)" control "a
volonte". This is consistent with my assumption above: by changing the
wires I forced the 2nd LSNAgetTimeData() to wait for all inputs to be
available. Because one input is provided by the 1st LSNAgetTimeData(),
I'm sure this one has completed before the 2nd one is invoked.
I cannot explain what is happening. According to the manual, all code
linked to each function node should complete before code linked to
another function node is executed. However, I think I've read
somewhere on the NI website that the UI consists of two threads and
perhaps something goes wrong (internally in LabVIEW ?) when the UI
thread is informed about the fact that the "Power (dBm)" control has
changed.
I don't claim LabVIEW is to blame ... FYI ... the version I'm using is
(the evaluation version) of LabVIEW 7 Express.
Thanks.
Frans.