04-01-2010 08:00 AM
Hey all,
We currently have a crudely working VI that acquires motor current data from one of several motors in an instrument we are testing. It does its job of triggering on the appropriate signal characteristics, then filtering the signal, displaying it, and identifying items of interest such as the maximum amplitude and the time of the max amplitude. However, moving forward we are looking to streamline this VI, but also make it more powerful for our needs.
Right now, the VI isn't robust enough to handle an "out of the ordinary" event such as a jam which occurs during the loading of the sample.... The motor currents we are primarily interested in are in the motors which load the samples into the instrument. At the moment, when a jam occurs, the VI is no longer triggered on subsequent sample loads and we thus lose our data for that jammed load: that is, none of that data is written to file nor displayed in the respective waveform graph..... Our goal is to modify the program such that it can handle events such as a jammed sample load and still return us the data for that event.
Our present ideas include making a trigger (or pulse or other means) that starts a timer. The trigger would activate on a signal characteristic that is present in all sample loads (but not necessarily evenly spaced throughout time because of other issues with the instrument design) - that is, the inrush current spike for the motor. That spike would trigger the counter to start counting. Now, we know the maximum amount of time that should be between sample loads if everything is running well. Therefore, we can create some Timeout logic where if another inrush current spike is not detected after X time, then a sample jam has likely occurred..... In which case, we would still want to have that data from the jammed load displayed and written to file. Does anyone have any ideas as to how to implement this??? (esepcially the part about preserving the data of that jammed sample load)....... Any example code or VIs which might help?
Thanks a bunch!!!
04-02-2010 07:46 AM
04-02-2010 12:30 PM
Hey!
Are you using NI-Motion for your application?
It sounds like what you are looking for is to have the while loop monitoring the trigger line, once it is triggered, it will fire the event to reset the cycle time as well as write the data to file. Is that correct?
04-02-2010 12:44 PM
Hi Andy,
No. i am not using NI-motion for the application. No motion needs to be controlled by our program. The instrument's own programming and our external testing scripts dictate its motions. We are interested in obtaining measurements of motor currents from the various motors in the device. Right now, our VI works rather crudely, but cannot handle unanticipated events such as a jammed sample load.
I need to find a way to create a timeout or other such mechanism where if the VI does not sense (that is, trigger on) an easily recognizable part of the motor current curve for each sample load (in our case, we chose the inrush current spike since the downstream characteristics of the curve are affected by too many factors), it infers that something has gone wrong, but still displays on the graph and writes to file as much data as it can... Right now, the vi basically stops working and nothing is displayed nor written to file in the event of a jammed sample load.....
I also thought we could make use of a sample collector..... Right now we aren't using one and that might be why our data for runs that have unanticipated events (jammed sample loads) just disappears..... Perhaps if I dumped all the data for every run into a sample collector and then passed that outside the overall while loop, things might be better.......
04-02-2010 01:22 PM
Andy,
I think I could use some sort of timed loop or other timed structure..... Furthermore, I think I could use an event structure and use its timeout to do what I am looking for.... Anyway, if you have some better ideas and/or example code, feel free to post it.
Thanks