08-15-2011 04:41 AM
Your "Simulate Signal" vi hangs up your code for 1 second, so don't expect to be able to do something at msec level.
What is it exactly that you want to do?
You could use a triggerd acquisition so that your acquisition starts when the pulse comes up.
By just taking one sample at a sample rate of 1000S/s you already have a 1 msec delay.
So please elaborate a bit on what you exactly want to do every x msec after a pulse shows up.
08-15-2011 04:45 AM
I would like to do two things.
1) I would like to measure the RPM of my analog signal.
2) I would like to measure the position of my shaft from my analog signal.
3) Once the position is known, this needs to trigger a separate VI to turn on a pulse at a certain angle every cycle, and turn it off after a certain angle every cycle.
1 and 2 is what i'm working on now.
08-15-2011 04:49 AM
@kramerfrog wrote:
labview can sample things at 100khz...i don''t think this should be a problem.
That all happens in HARDWARE!!!!!!
The software waits until the requested number of samples are acquired and then process the received data while the card starts a new acquisition, if it was a continous acquisition.
Assume you asked 100kHz sampling rate and requested 10.000 samples, that means that every 10msec a new bunch af data is available from the card.
If your code needs more than 10 msec to process the data you will end up with a problem!
08-15-2011 05:06 AM
@kramerfrog wrote:
2) I would like to measure the position of my shaft from my analog signal.
Please don't say that again because you can't measure the position of the shaft, just calculate the position based on a time controlled loop and previously calculated speed of the shaft.
You have a 5V pulse signal every rotation, right?
Why don't you use that as a digital signal?
Did you look at the examples?
I think the "Read Dig Chan-Change Detection.vi" or "Cont Acq&Graph Voltage-Analog SW Trigger.vi" are good places to start to capture every single pulse of you shaft.
Once you're code can do that, you can think on further processing.
08-15-2011 05:47 AM
08-15-2011 06:25 AM
Yes I did but since you're "Generate Signal" holds your code for one second you can't do what you want with that code, except caculating the speed.
So, I suggested more suited code from the LV help you could use as a start.
An even better solution would be to place 2 notches on the shaft or use 2 proximity switches instead of one to trigger your new code.
Then you can use a triggered acquisition. Your code is always waiting from triggers coming from the hardware.
But of course I don't know if this is possible or not.
If you can't change the shaft and/or add switches, you better have a look at triggered acquisitions as I mentioned earlier.
I think your first step should be to try out those vi's so that each pulse from the shaft is detected at all times.
08-15-2011 06:29 AM
yes, i did look at that. it still requires the user to define sample and sample rate though...i don't see how it gets around the problem.
08-15-2011 06:39 AM
With the 2 vi's I suggested you move the pulse detection from the software to the hardware.
The hardware is way faster than any code.
The software is doing nothing unless it's triggered from the hardware.
Sample rate depends on the application, so you have to set up the sample rate according to it.
08-15-2011 09:20 AM
Well with one pulse per revolution you can measure the RPM
Now you have an other event (have you?) and want to find out at what position??
What exactly do you want to measure?
08-15-2011 10:03 AM
Duplicate post.
http://forums.ni.com/t5/LabVIEW/quot-relative-quot-real-time/td-p/1667352
You still have people responding to your other post. Why the second thread?