08-01-2013 02:15 PM
Your conversion looks like this (after some re-arranging to make this part more compact):
The simplifed conversion:
Now you have an array of booleans representing the comparisoon one every data point in the wavefrom, not just the first or last as coerced by the DDT conversion.
With this array you will not use the Point By Point Boolean Crossing VI but something which performs a similar function on the array of booleans. I have no idea of what the algorithm in your inner loop is doing so I cannot recommend an approach to using the boolean array.
Lynn
08-01-2013 03:44 PM - edited 08-01-2013 03:48 PM
I just made these modifications and the indicators I make for the arrays are very intermittent. I understand the speed I have to adjust, but how can these values be read smoothly? Could I average them? Just for the indicators?
08-01-2013 08:04 PM
You can average things for the indicators. That is often done, especially if the data is noisy.
Your program is complicated enough and I do nota have enough detailed information about what it is doing to be able to give detailed recommendations.
Lynn
08-02-2013 10:49 AM
Basically the portion of my code which I'm working on is the count portion. The Idle state reads my analog channels and outputs them to indicators. Once I press the Record button, the action starts.
In the Stress state it takes the last Horizontal Load value which is passed from the Idle stage (Local variable - I know I plan to change this). This happens when you press the Record button. Once in the Stress state, It compares the last Horizontal Load value passed from Idle state the with a 0.02 value change (constant).
Once this change occurs, it starts measuring data and counting. The counting is a Point 2 point crossing.vi which I have modified to cross at the Horizontal Load value passed from the Idle state (the same value that is compared to a 0.02 change). This is an offset essentially. So everytime it crosses this offset, my count will change. My count value is also store in the first column of my data file and changes with each crossing.
Since I have changed my datatype to arrays, from scalars, my point2point.vi is outputting an array of booleans...I know you said I couldn't use the p2p.vi for this, but is there another solution?
I know my code is hard to follow but I would appreciate some help with this if you can.
Kindly,
Gary
08-05-2013 06:36 PM
Let me know if this helps
http://digital.ni.com/public.nsf/allkb/FA82F666FF792FDA8625709900662DC4
08-12-2013 10:20 AM
Lynn, what advantages would your suggestion of a Producer/Consumer architecture have?
08-12-2013 01:25 PM
The basic concept of the Producer/Consumer architecture is to use parallel loops to separate tasks which have different priority or different timing requirements. All the DAQ stuff could be in the Producer. All the display, graphs, calculations, and file operations would occur in the Consumer.
The Producer would run continuously and send the data to the Consumer via a queue or queues. The data for the digital output would go the other way via a separate queue or notifier.
By separating the tasks into paralllel loops you can decouple the timing. With appropriate buffering the differences in loop rates no longer matter. The Producer loop runs at a rate determined by how fast you want to sample the data and what size chunks of data you need to retrieve. The Consumer loop timing may be driven by the rate at which users can interpret display updates or how long the file writes may take. The DAQ loop might run at 10 or 20 Hz while the Conumer loop runs at 1 Hz.
Lynn