I would like to convert a time-varying scalar to a true/false variable. To clarify, I would like to take a time-varying scalar and pass the value of the zeroeth bit to a true/false variable which can then be passed to a digital line output device. The DO device has solid-state relays and its DAQmx driver requires a true/false input and does NOT permit a scalar nor digital signal. It seems to me that this is a very simple c-language intrinsic function call.
I have looked at the SE Steps-Anaylze-Analog-Formula functions but they always output another scalar. The Trigger step outputs a true/false momentarily and does not latch. Limit Test has a true/false output but that is for all samples in aggregate of the scalar and not any one scalar value.
Any suggestions? or better yet, can someone post a simple LV vi which does this simple data conversion? Is there some utility vi hidden on the installation disk somewhere that can do this?
Solved! Go to Solution.
The scalar is simply that which SignalExpress creates and stores as output from many different "Steps". It seems to me that all scalars in SignalExpress are REAL data type and 32 bits. For my purpose I need to move the value of bit Zero (0) to a variable that SignalExpress sees as data type True/False (boolean) which can be input to a DAQmx step which takes only that boolean data type. This is a rare case as very few DAQmx drivers demand a boolean and only a boolean as input. Since such DAQmx drivers do exist then it seems to me that SignalExpress should accomodate them by providing bit manipulation and conversion functions as found in "C" libraries. This should be very easy to add to SE???
Thank you for asking.
So it seems that the LV folks need similar utilities and I found this example LV code. I could conceivably use the Boolean_Array_to_SGL and then pass the "Sign" true/false to my PXI-6528 DIO card for line control. What I need for a vi is so minor that I feel very frustrated that no one with LV can help.
see this example:
what I really need is as simple as the Convert_from_Hex block example but in reverse, as in Convert_to_TF.
I have gained some clarity and solved my problem through built-in SE capability. I can do exactly what I need through the "Alarms" utility which can process the Trigger step's momentary True/False boolean into a latched DIO signal on my PXI-6528 board. Furthermore, I will explore using the "software trigger" result from the Alarm utility to get around the "reserved resource" limitations. Thanks to all that at least considered my problem.