04-01-2014 11:54 AM
I am trying to Measure two analog signals for 1 second at 1K hz.
I am controlling three digital outputs.
At.05 seconds i want Dig output channel #1 to energize. Which causes analog PSI to rise.
When analog output channel #2 reaches 73 PSI. I want the digital outputs #2 and #3 to energize and stay energized. Which drops the PSI.
@ .7 seconds i want digital outputs #2 and #3 to de-energize.
My problem is the while loop is taking to long to execute.
This process needs to take place at 1K Hz. Suggestions?
04-01-2014 04:24 PM
I have tried usign an analog trigger to control the digital line, but recieve an error.
04-02-2014 07:29 AM - edited 04-02-2014 07:33 AM
anyone point me in the right direction?
04-02-2014 02:31 PM
What hardware are you using? For real time controlled events, you will likely need to look at FPGA devices to ensure the exact timing you require.
04-02-2014 03:01 PM
Analog module ni 9205
digital module ni 9401
04-03-2014 04:28 PM - edited 04-03-2014 04:29 PM
Unfortunately, you will not be able to control the timing of this structure closely enough to ever guarantee that it runs exactly at 1 kHz. Even the trickiest coding to ensure close approximations of timing (but not extremely accurate) will result in slower sampling rate of your analog input.
As I mentioned previously, the only way that I know of to guarantee the execution timing will be to look at our real time targets using FPGAs. These will allow specific routings for each clock cycle. For more information on our CompactRIO products see the below link.
04-03-2014 04:55 PM
Here is what you should look at: Analog Triggering of a Digital Signal
Here is a general White Paper discussing Analog Triggering.