LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart not working with boolean

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 correctlyContact Switch Boolean.png

0 Kudos
Message 1 of 13
(5,633 Views)

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? 

0 Kudos
Message 2 of 13
(5,625 Views)

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.

0 Kudos
Message 3 of 13
(5,614 Views)

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.

0 Kudos
Message 4 of 13
(5,609 Views)

If you want to take a good advice, FORGET about DAQ Assistant, and his evil sidekick, the dynamic data type.

Use proper DAQmx functions.

Message 5 of 13
(5,594 Views)

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.

0 Kudos
Message 6 of 13
(5,578 Views)

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.

0 Kudos
Message 7 of 13
(5,542 Views)

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.

0 Kudos
Message 8 of 13
(5,532 Views)

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.

0 Kudos
Message 9 of 13
(5,501 Views)

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?

Download All
0 Kudos
Message 10 of 13
(5,482 Views)