LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

advice on finishing touches for circuit.

well, im all out of ideas! was up till midnight last night trying to get this working properly, but to no avail. any suggestions mark?
0 Kudos
Message 21 of 44
(1,047 Views)

Hi,

I tried running a stripped down version of your code here, and see what you mean about it only returning data once. Have you tried removing the Start DAQmx vi (the one with the greeen arrow) from the Initialise case? It seems to work here.

I haven't got your analogue limits trigger VI in the zip file you posted. How are you getting on with getting pre-trigger data working in finite samples mode?

Cheers,

Mark

0 Kudos
Message 22 of 44
(1,047 Views)
its definatley getting closer. i removed the startDAQmx.vi as suggested. works better, however, roughly 1 in every 6 interations is not triggering properly. quite often the first cyle in (roughlly) every 6th itreration will start at about 90 degrees.  ive attached the latest version, and shows exactly how i ran it. ive also tried with continuous and finite, sending back to aquire and also  initialise stages (after saving), but to no avail!

cheers
0 Kudos
Message 23 of 44
(1,040 Views)
still never managed to get that working properly mate. any other ideas?
0 Kudos
Message 24 of 44
(1,015 Views)
Hi G,
 
Thanks for your post. I've had a quick look at the VI, I haven't used the analogue soft trigger VI much in the past, but I saw your problem. I seem to be able to make the VI  trigger on the zero-crossing going positive if I force a restart on the soft analogue trigger VI (so connect a TRUE boolean constant into the input terminal on the underside of the VI marked Force Restart).
 
I've set the triggering properties to be Rising Edge, with a level of 0 and a hysteresis of 100m. What this acutally does is check when the signal goes over 0, then check when it's over 0+100m, then takes all samples after that (so if you'd like to take all samples from the 0 cross onwards, I think you need to set the level to be -100m if the hysteresis is 100m.
 
I've attached the VI I'm using to test now, can you let me know whether it works better for you (or you're setting different triggering conditions?) I've also removed the wait time between each state, so that the counter updates as fast as possible and tidied up the front panel slightly. I haven't tested obtaining pre-trigger samples yet.
 
Cheers,
 
Mark
 
 
0 Kudos
Message 25 of 44
(1,010 Views)
ah, great. thankyou kindly. 

maybe you can tell me if this is possible. whilst i need to capture 10 cyles of a 50 Hz signal, and if im sampling at 5KS/s, i would simply just read back 1000 samples. thus fs/50Hz * 10 cyles. though, if the fundamental freqency is not always exactly 50Hz, as in reality. how then could i ensure i do get exactly 10 cyeles, and not 9.5 cyles, or 10.5. or is this just a limitation of the design , and i should just accept greater or equal to 10 cyles.

i dont want you to waste anymore of your time on me, but if you know of a quick solution then i'd love to here it .


thanks again. Griogair.
0 Kudos
Message 26 of 44
(1,007 Views)
actually. that doesnt want to open for me mate? i dont get any errors, it just doesnt do anything.  is  it saved in 7.1?
0 Kudos
Message 27 of 44
(999 Views)

Hi Griogair,

Sorry you couldn't open the previous post. I had a quick look for easy ways to force an integer number of cycles in LabVIEW, but couldn't find anything suitable straight off, so I created my own sub-vi for it (called zero-crossings) It searches for all the zero crossing points and then returns the position of the n-th zero crossing point. This means that you can then take a subset of the readings corresponding to 0 up to the nth crossing point, hence returning an integer number of cycles.

I've left it with a control so at the moment you can specify the number of cycles you want - you could obviously replace this with a constant if you only ever wanted 10. Remember that if the waveform never actually equals 0 you won't see it touch 0 at the start and end of your trace  - it will appear closer and closer to a zero cross the higher your sampling rate is relative to your input signal.

Please let me know if this helps (I hope this one opens OK!)

Best wishes,

 

Mark

0 Kudos
Message 28 of 44
(989 Views)
hi mark. thanks again for all your help. im getting the same trouble as before, and it would appear that at least the zero crossings vi is saved under LV8 format. please advise?

thankyou.


Griogair.
0 Kudos
Message 29 of 44
(983 Views)
Hi G,
 
Sorry you still can't open the VI, this is really frustrating!
 
I've tried attaching it again without zipping it this time. I hope the sub-vi is opening OK for you.
 
Best wishes,
 
M.
0 Kudos
Message 30 of 44
(979 Views)