03-07-2016 01:55 PM
I'm trying to use a contact switch to signal when a specific event occurs. I have wired a contact switch into one of the TC channels to collect the normally open vs closed signal. I would like to convert this reading into binary numbers (1 if contact is made, 0 if contact is not made) to set a threshold value for the signal. I found a Boolean command that does just this, however, my waveform chart is no longer displaying correctly. Only small portions of data show up on a fraction of the chart display, it doesn't fill the window like it usually does. I have included a screenshot of the VI. If I eliminate few blocks circled in red, the chart displays correctly
03-07-2016 02:02 PM - edited 03-07-2016 02:03 PM
Hi, your screen shot is sized really small, and I can't see any detail. Could you post your code for us, or at least a bigger screen shot?
Also, is there any reason you can't use a LED Indicator on your front panel, or a case structure to write a value of 1 when the boolean is true and 0 when the boolean is false?
03-07-2016 02:07 PM
I don't have the entire code with me, but I attached the screenshot so hopefully you can make it larger.
I'd like to also record this boolean value for the entire test. Maybe an indicator or case structure would work, I'm not super familiar with labview yet.
03-07-2016 02:11 PM
You need to attach all the code.
The important part, where the data gets to the terminal for the waveform chart, isn't shown in your screenshot.
03-07-2016 02:25 PM
If you want to take a good advice, FORGET about DAQ Assistant, and his evil sidekick, the dynamic data type.
Use proper DAQmx functions.
03-07-2016 02:57 PM
Here's the main VI, I hope this helps. Someone else has build this code and I'm taking over but have little LabVIEW experience.
03-07-2016 04:04 PM
Can you save the file with the chart data intact so we can see it?
Run the file to get some of the "wrong" graph, stop the VI, then right-click the graph, and select "Data operations --> Make current value default".
I also agree that getting rid of dynamic data wires is a good idea, the sooner the better.
03-07-2016 04:27 PM
When I strip out parts of your code that I can't use (no DAQ, no serial instrument) and just simulate getting data, it works for me.
I think your problem is that you are using the blue dynamic datatype wire. I just hides what is going on inside the wire and just hides the conversions in the data.
I think other issues are that you have a tangle of queues and notifiers going on with extra loops you don't need. You don't need a separate display loop and chart loop. You should have a separate loop for writing the data to the file. You can know that down to a single queue.
FYI. Index Array is resizable. You don't need to drop 5 of them on the diagram with constants wired to each. Drop 1 and drag the bottom border downwards. Now you've got element 0 through 4 in order by default without ever having to wire up a constant.
03-08-2016 11:14 AM
So if I eliminate the DAQ Assistant, it will eliminate the blue dynamic datatype wire and hopefully provide improved performance?
Also, can you provide me a little more guidance on eliminating the extra queue and loops? I don't fully understand the queue thing yet.
03-08-2016 05:50 PM
I tried saving the "wrong" data and it doesn't appear to be working. I think it is displaying the correct values, however, it is not occupying the entire chart window like in the attached picture.
Also, I eliminated the DAQ Assistant and introduced the DAQmx protocol instead but not I am no longer reading any values at all. I still have some dynamic data going into the queue structure. How do I eliminate this?