Jump to content

Micro seconds in Labview


Recommended Posts

I am wondered if labview can operate with loop as for and while with time in micro seconds

I tried to make a program that control a servo motor HS311 that needs a train of pulses to control its position

The pulse width is between 0.9 to 2.1 ms and i can not output a signal with 0.1 ms = 100 us, it only output 1 ,2 ms

How I Can ?????

Please help

I attach a file to help to understand or solve my problem

Link to comment

Presuming you are running under a Windows OS, such timing cannot be achieved in software. There is just too much overhead from the OS, in addition when another process takes prioirity over your vi, timing will become slower and unpredictable. You could look at timed loops though, but performance may not be up to your requirements.

You need a hardware solution- a DAQ card with counters/timers to get short duration and accurate pulse trains with adjustable duty cycles. Or possibly LabVIEW RealTime (RT). Another alternative, since you are attempting motion control is to get a dedicated motion control card.

Link to comment

QUOTE(spacetoon34 @ Mar 8 2007, 02:09 PM)

I am wondered if labview can operate with loop as for and while with time in micro seconds

I tried to make a program that control a servo motor HS311 that needs a train of pulses to control its position

The pulse width is between 0.9 to 2.1 ms and i can not output a signal with 0.1 ms = 100 us, it only output 1 ,2 ms

How I Can ?????

Please help

I attach a file to help to understand or solve my problem

If you have got an RT-System, then you have the micro seconds available for the timed loop...

Link to comment
  • 2 weeks later...

QUOTE(Eugen Graf @ Mar 16 2007, 03:28 PM)

I knew of them what you wrote, but why Windows don't give a NOP functionality, how in uCs. I don't want to wait any determenistic time, but less than 1 ms without 100% CPU load.

Eugen

Should I ask Bill Gates?

:thumbup:

A NOP would still give you 100% cpu load since all it does is increment the program counter and eats up exactly one clock/instruction cycle. A loop of NOPs would indicate 100% cpu usage. It always has.

If you want NOP functionality, you need to use rafa's idea of an active wait, cause thats all NOP ever did.

What you want is a thread Sleep with more than 1 mS resolution (Want to me to break out my grouchy old man voice and tell you that not long ago the best we could hope for was 15 mS resolution?). As others have stated, Microsoft's Desktop OSs don't offer that resolution for a multitude of reasons, the most fundamental being you don't need it for an OS designed to be operated by humans.

If you only get 100% usage while talking to your hardware and you don't have it pegged for hours on end, I wouldn't worry about it too much. But if you're hung up on it here's how you can reduce it. Run your little loop without any delay for 999 iterations. And on iteration 1000, add a 1 mS delay. Rinse. Repeat. It'd be smarter to add that little delay at some non-critical moment instead of a fixed 1000 iterations, but hopefully you get the idea.

Better yet, check and see if your [wiki]DAQ[/wiki] card has any buffer memory where you can write a waveform.

Link to comment

QUOTE(crelf @ Mar 19 2007, 12:58 PM)

I think you need to look at the definition of determinsim - what you're asking for sure sounds like determinism to me: a timeslice with an acceptable jitter.

I opine not any time items, I want only unload CPU for some processor-ticks. Nothing with determinism.

Eugen

Link to comment

QUOTE(crelf @ Mar 8 2007, 12:23 PM)

The term you need to research is "determinsim" - Windows is not determisitic at the microsecond level.
Not in the normal "User Mode", also known as Ring 3 priority. Spacetoon, your best bet is ti use a hardware card with a counter and then trigger off the HW clock, perhaps using [wiki]DAQ[/wiki] Occurences. What you ask for, a software accessable submillisecond timer, is possible under Windows, and you can even make it deterministic, but to do so you have to write a Kernel Mode (Ring 0) device driver, (these used to be called Virtual Device Drivers, or VxDs) then access that driver through another Windoes DLL, then access the DLL through either a Call Library Node or an Occurence hooked to the DLL.

None of this is for the timid. It is a black magic, alchemy type of programming that is guaranteed to introduce you to the BSOD. Take the easy way and use a cheap timer card & HW timer.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.