07-20-2012 10:13 AM
Hi,
I have an array on my interface that is send to my DAQmx.
In DAQmx I use scales so when I write the values to my hardware I check if those values are within the range of those scales and I adjust the array accordingly.
So the values to the hardware are changed but I do not see this in my array.
For now I write the adjusted array again to the control with a local variable.
But when I type a new value in my array while the program is working with the older value, the control is reset to this older value.
So I can try typing in a new value but it will not be accepted.
It really depends on timing....
Can someone offer me a workaround so that the value is coerced if necesarry when I type it?
I tried with "data entry limits" but this sets all array elements to the same limits and my channels all have different minimum and maximum values.
I think it might be possible with Xcontrol, but I really do have no experience with the technique!
Thanks!
07-20-2012 10:23 AM - edited 07-20-2012 10:25 AM
HI,
If you are using an array control, in order to update those values into memory you would have to read the array again after you update on the front panel.
So you need to have a loop that re-reads the array values after you update them.
You could also use property nodes to set the values. If you do this, you still have to re-read the array to get the new values. You could also use another property node to read the values instead, or use a local variable. However, the local variable has to be read by the program after the control is updated ( either by front panel or property node). I would not recommend using lots of property nodes, however.
You question is a bit general, if you post the code a more specific answer can be suggested.
Also, generally speaking you want to develop a loop or state machine type architecture if you plan on updating and reading the front panel control, rather than try to "shoe horn" by using property nodes and local variables.
07-23-2012 08:19 AM
As was already stated, we really need to see code in order to give recommendations.