Integrator control with timed loop
Hi all, when dealing with discrete time control like the poleplacement method, the sampletime shouldn't necessarily be
as short as possible like in "analog" PID-control.
I want to be able to set the time of how often I am sensing the input and therefore I am using a timed loop.
Something is missing in my file because it won't work.
The propertynode DigNum is not inserted by me, but by the png-software. I have a local variable there refering to the period dt.
Kindest regards,
Lasse
Attachments:
Integrator control with Timed Loop.vi 118 KB
Hi Lasse,
"Something is missing in my file because it won't work."
Yes, the error description is missing. What is wrong? What exactly doesn't work?
- Instead of using locals you could use a wire or the block in the upper left of the TimedWhileLoop to get dt from it...
- Does the loop spin as fast as you want it to spin or do the ExpressVIs slow down the execution?
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Similar Messages
-
Error -50103 occured with timed loop inside a while loop
Hello everyone,
i wrote an application to sample analog voltage from DAQ6024E card (see the attachments).
I have a big while loop in the VI because a I want to add some other functions later.
In the "WHILE_Cont Acq&Graph Voltage-Int Clk.vi" I use a while loop inside the big while loop to read the samples. It's working properly.
but when I use a timed loop inside the big while loop (see "TIMED_LOOP_Cont Acq&Graph Voltage-Int Clk.vi"), I get an error -50103 from the timed loop. It seems that the first cycle is ok, but after the first cycle the error occurs.
I don't know what happens with the timed loop, anyone can help me? what does the error -50103 mean? thanks a lot!
PS: I am using LabVIEW 8.0
Message Edited by molo511 on 10-22-2006 05:21 AM
Message Edited by molo511 on 10-22-2006 05:23 AM
Attachments:
TIMED_LOOP_Cont Acq&Graph Voltage-Int Clk.vi 143 KB
WHILE_Cont Acq&Graph Voltage-Int Clk.vi 75 KBhi molo511,
I tested your program but only with simulated devices. I had to delete the wire to the timing, so that the timed while loop runs with 1kHz. Did you already try this? Because this works on my PC.
I also found a link in our database that might be interesting for you.
http://digital.ni.com/public.nsf/websearch/04BEDD9E9E91ED3486256D180048116D?OpenDocument
Greets
Philipp N.
NI Application Engineer -
Using timer/counter with PCI-6221/USB-6210 to control timed-loop VI
Dear all,
I need to ask about two devices and one of their functionalities, PCI-6221 and USB-6210. For our NI-based system, we need to control some timings in a Timed-Loop vi, for that currently we are using PCI-6221 and we give external TTL signal (at 1 kHz) to it,
recenntly we need to make some changes and for that we found USB 6210 DAQ to be more suitable, but we need to clear ourselves on some specific things.
Can the counter/timers functions available in the either PCI 6221 or USB 6210 can be used to control the Timed-loop VI by giving external clock or by using their own internal clock source?
Although we are using external clock with the PCI 6221 but we want to know about the usage of their internal clock, also are controlling timed-loop also possible for USB-6210
Also... What if we use the RTOS, are they still able to control the timed-loop VI without giving any 'EXTERNAL CLOCK' and using the internal clock sources of the DAQs
Waiting for reply,
Bests,
RaJaf
Solved!
Go to Solution.Ben,
I having read previous email which I send earlier with general overview, we discussed in more detail within our team and I am giviing the specific answers.
Please check in RED the most recent answers. Blue are the questions/suggestions by your side.
1. Using Internal hardware clock of PCI-6221 would enable us get rid of external clock, but how to divert the internal hardware clock to the current settings. Any idea (can you provide us with some reference manul for otherwise). I mean is there some flag-bit etc. or VI
2. Is it also meant that with the installation of RTOS the timed-loop can directly get the timing source from the internal hardware clock PCI-6221? --- How???
3. In order to make desktop to work as RT system, what is the hardware (motherboard, processor, etc..) requirement? What are the LabVIEW modules (specific name) that needed to be installed? Our platform is LabVIEW 8.6. (Currently we have windows-7 with i7 core processor)
What kind of application are you intending for this system? ---- high-speed laser scanning system.
Are you most concerned about accuracy, speed, or responsiveness? To control the laser mirror scanner to move at 1 kHz or 2 kHz speed. On the other hands, using PCI-5105 (128 MB memory) as a DAQ for real-time/on-the-fly data processing.
Bests,
RAJAF -
Does two timed loop work together? is it possible....
Hello
I use Crio in scan mode and have problem with timed loop. I use two timed loop for two different PID loop. I need to get 1ms delay for PID loop. But When I two run realtime side with timed loop, only one of them work (when ı send command from host side). Is it possible to run two time loop 1ms. How can I configure each timed loop work together properly? (ı configured the each time loop as synchron scan enginee 1ms)
Both array are used for sinusoidal position data form host vi. I use time delay (1 ms) to make certain frequency with sample size(I adjust sample size for 1000 for 1 hz 500 for 2 hz).Each loop control to position of servo system with PID. So I use two VI in my host side and I send two different sinus data with array. I tested with one timed loop it works vey well. But When I try it two time loop it dosent work.
Attachments:
RT TEK.vi 105 KBTwo loops in parallell is quite easy, you just need two unconnected loops. If there's a wire in between you get data dependency which means the 2nd loop will wait until the 1st one finishes.
Is that what happening to you? (I cant open the file)
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
LabVIEW crashes in timed loops
Hi,
I'm running LabVIEW 8 on a
Pentium D, 2 GB RAM, Windows XP sp2 with an ETS target Pentium 4, 256
MB RAM. I have two timed loops in a sequence, so they do not execute at
the same time. A similar sequence is on the target allowing me to make
a state machine between both computers.
The loops on the host
simply update the GUI for the user have a large period of 45-ms. This
makes the CPU usage virtually zero. Also, task manager tells me that
LabVIEW on the host only uses 200 MB of memory, so I know that the
computer is not running out of memory.
When I run the multiple
VIs, the host will randomly crash. It works about 9 times out of 10
with no crashes. Windows will tell me that it (is sorry and) has to
close LabVIEW on the host. The target side continues to run like
nothing happened. When I click on the link requesting details, I get
this information from Dr. Watson:
AppName: labview.exe
AppVer: 8.0.0.4005
ModName: lvalarms.dll
ModVer:8.0.0.6
Offset: 00001df4
I
have narrowed it down and I know that it will only crash in the two GUI
loops. Does anyone have any ideas about how to approach this problem?
-JRecently, I have had similar problems with timed loops (LV8.0.1/W XP). According to NI's answer, this is linked to hyperthreading. Unfortunately, until now, my question if this incompatibility is a bug or not remains unanswered. Because my application is critical, I have replaced all the timed loops with while loops even if the crash didn't appear during a short test with disabled hyperthreading.
Hope this solves your problem.
Here is an extract of the exchange with JR Andrews from NI :
04/04/06
The preliminary investigation of the issue indicated that it may be due to hyperthreading (or having dual processors) and that disabling hyperthreading resolved the issue as a potential workaround. If you have the time and ability, I would be interested to know if you were seeing the issue on a hyperthreaded machine and if disabling hyperthreading does in fact resolve the issue for you. I can then pass that information on to the developer to assist them in fixing the issue.
Regards,
JR
JR Andrews | LabVIEW Real-Time & PDA Product Support Engineer | 512-683-2820
05/04/06
Even though your computers only have 1 processor, that processor may be using "Hyperthreading" to make it appear to the OS that there are 2 processors. You can check this by looking that Performance tab in the Windows Task manager or at the number of processors shown in the Device Manager. I've attached a screen shot of my system which is a single P4 processor which is hyperthreaded. Disabling the LV option for "Run with Multiple Thread" would probably not have any effect because to Timed Loops are always their own thread and that setting only applies to non-timed loop LabVIEW code. So I wanted to clarify that double check that your machine indeed does not have hyperthreading. To disable hyperthreading, you can go into the BIOS and you should be able to disable it. You can always go back and enable it again too. -
Shared variables + timed loops + naming conventions + how to find all
Being almost halloween, thought I'd share some more eerie behavior I've noticed with shared variables.
1st strangeness with timed loops already mentioned here: http://forums.ni.com/ni/board/message?board.id=170&message.id=209475
2nd strangeness: If you have a shared variable that is network-enabled, it is OK to use a "?" in the name (eg, "RT_Simulate?").
However, should you decide to change that variable to single-process, or if you create it that way in the first place, you will get this dandy message from the broken arrow you now have:
"LabVIEW could not generate code for the shared variable. You must open the VI in the project that contains the library where the shared variable resides."
..............whaaa????? Loosely translated, this seems to mean "Don't use a "?" in your single-process variable names."
3rd strangeness: I don't know if this has been mentioned before....
If you have an application that references a network shared variable, and the library has NOT been deployed, the app will hang for some time (approx. 7 seconds! on my machine) before returning with an error. This seems to be the case whether or not the error ins/outs of the variable are wired. This looks bad to me, and I'm not sure what is causing it (some sort of timeout when attempting communication with the SVE I assume). Has anyone else noticed this? It should be easy to reproduce. Any ideas?
I haven't done any bug notifications yet, but will do if there are no positive solutions by next week some time.
-Have a Great Halloween WeekendWHAVEman,
Currently (as of LabVIEW 8.20) there isn't a way to programmatically interact with the shared variable engine outside of using DSC. If you had DSC you could "hack" a way to determine if a shared variable was deployed.
I think the best way to get around your program hanging is to have an initialize state where you write a dummy value to each variable. If the variable isn't deployed, then you should get an error out of the shared variable. Problem is that there's probably going to be a timeout associated with determining if the shared variable is deployed. But at least you can use the information from your initialize state throughout the rest of your deployed application.
Chris C
Chris Cilino
National Instruments
LabVIEW Product Marketing Manager
Certified LabVIEW Architect -
Timed loop with array dimension control
Hello,
I have imported an excel to an array and im trying to use a timed loop to run the values of the array on a timed interval. One of my problems is that the array is 2D and i cant use its length to stop the loop. I want to use witch value of the array in the loop in each iteration of the loop and i want the loop o stop when the counter equals the length of the array. Can someone help me plz here is the labview.It is really unclear what your question is. Could you clarify?
If you are struggling with why you have a broken wire it is because you are sending an array to the stop of the loop. When you use the array size function on a 2D array it returns a 1D array with the size of each dimension. When you then use the greater than function it returns a 1D array of Booleans. It compares each element of the array size to the current count of the iteration terminal.
To use this to stop your loop you need to reduce it to a single element some way before you send it to the stop control of the loop. You could apply an "and" or "or" function to the out put of the greater than or pull out a single index out of the single greater than array.
In the image logical AND, logical OR, or element could be used to stop the loop. You just need to choose one that gives you the behavior you need.
Lukin
Certified LabVIEW Developer -
Timed Loop timing source - Control Loop From Task is too slow
I'm trying to make a Timed Loop run at a period of 2 ms, with an analog input task running at 50 kHz as timing source. The input analog signal is scaled and fed into a synchronised analog output task on the same multifunction DAQ board. Using the built-in 1 kHz or 1 MHz clock as timing source for the Timed Loop works great, except for a slight time lag between the loop and my AI/AO tasks which over time becomes unacceptable because my task will be running for up to an hour. However, when I use the DAQmx Create Timing Source: Control Loop From Task vi to create a timing source, everything slows down and the fastest loop time I can get is around 20 ms. Any suggestions to get around this would be highly appreciated!
System: LabVIEW RT 8.0 with DAQmx 8.0 running on an NI PXI-8186; NI PXI-6251 used for analog input.You're welcome!
You can build an array, and if your data is not hugh (100's of MB) this may be the easiest solution. However, we aways suggest implementing the Producer/Consumer Architecture. Keep the PID in the Producer loop, but move the File IO to the Consumer. Also, it appears that your instrument uses some form of serial communication, so that could cause lags in your system....
What is your application about in general, what performance are you hoping for, etc?
Joshua B.
National Instruments
NI Services
NI Support Resources
NI Training Resources -
Resetting Integrator in Control and Simulation Loop
Hello,
I am trying to run a real-time simulation in Labview 14. I have prepared front panel controls and data flow such that I can reset the simulation to some preset initialization values upon clicking a button. However, I am not able to figure out how to reset the integrator in the control and simulation loop. Even after reinitialization of all the values, the integrators will overwrite the initialization values with whatever they were holding. Please help me find a way out.
ThanksPlease share what code you have so that we can see what you've tried and understand exactly what you're trying to do.
-
Controlling processor on the timed loop
Controlling attributes of a Timed Loop does not seem very straight forward to me! I experience crashing my VI very often when my Timed Loops are featured with controlled period and sometimes processor and offset on their next iterations. Of course there are queues between the Timed Loops, too. Not yet sure of the cause of the frequent crash!
Hi Siamak,
Good Morning and I hope your well today. Thanks for your post.
I have seen you have received no support so far.
Can I ask if you have carried out any further troubleshooting of the issue? Have you got a simple example peice of code which reproduces the crash?
If you think its your wide application - how have you design it?
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! -
Timed loop running parallel with Queues
I was wondering if it is possible to have a Producer/Consumer Pattern with a timed loop that is not just executed when it is called by the queue or from the Producer Loop, but also executes the timeout after a given time.
Thanks in advance, Oliver
Attachments:
example.png 42 KBlol
thank you Norbert great advice
I was so focused on wanting to use a Timed Loop that I totally forgot about the dequeue TimeOut
cheers Olli -
What is wrong with this (timed loop error)?
I can't figure out why the timed loop is not starting and I receive an error -805 message. Any idea?
Thanks,
Ben64Hi Ben64,
There's no obvious problem.
I tried the same and it works perfect.
So there must be a problem under the cover.
I have 2 suggestions.
1) There is a problem with your wiring -> the Error wire is not connected to the loops error out -> close timing source is executed before the loop is executed (Are you sure the loop doesn't even start ?)
2) Labview often uses Names to identify items (queues, images, semaphores,..... timing sources(?) )
I tried to open and close another timing source with the same name.
Et voila : I'm able to get exactly the error code you mentioned.
Is it possible you use the same name for a second timing source and this one is closed prior to executing the timed loop you've got problems with ?
Best regards,
Balze
Attachments:
timed_loop_2010.vi 37 KB -
Cross-enterprise integration of SAP GRC Access Control with PeopleSoft
Friends,
Does anybody has/have/had the owner to implement Cross-enterprise integration of SAP GRC Access Controls 5.2 with PeopleSoft ?
If yes, what are the key points and approach one should keep in mind while going for this kind of cross-enterprise implementation.
Is there any reference material, blog, wiki or such informative resource regarding cross enterprise GRC implementation available on the web?
I tried to search, but could not get good results.
Any help would be highly appreciated.
Best Regards,
Amol BhartiAmol-
From my experience:
CC 5.2 with Peoplesoft: as long as you have the RTA's installed in the Peoplesoft system and create the connectors in CC, you are good to go.
AE 5.2 with Peoplesoft: cannot provision to Peoplesoft, however you can connect with Peoplesoft HR for Password Self-Service. You have the capability to provision to SAP HR.
FF 5.2 with Peoplesoft: N/A
RE 5.2 with Peoplesoft: N/A
I am not sure if there are any standalone docs out there for AC integration with Peoplesoft. And the 5.2 manuals have sparse information on integration. However, the AC 5.3 manuals have more detailed info on the integration piece with various other non-SAP systems.
Sorry, I couldn't share more info, as that is all I know for now...
Ankur
GRC Consultant -
Hello,
How can I do a time with while loop?. I want to read a data in the While- Loop for 1 sec and then go to B .. I added a pic,
Attachments:
while- loop.GIF 6 KBnichts wrote:
Hello,
How can I do a time with while loop?. I want to read a data in the While- Loop for 1 sec and then go to B .. I added a pic,
I would use as GerdW has mentioned,"elapsed time.vi" in a statement 1st case structure, after set time has elapsed> goto 2nd case structure. try not to use flat sequences....this can be done with case statements with transitional coding. I have noticed young LV programmers like to use flat sequences...I think it's a trap set up by LV developers? -
Control with lingo a film loop
Dear all:
Do you know how to control a film loop. Stop, pause, rewind
and play?
many thanksThis behavior, dropped onto a filmloop sprite, should do it
for you:
[email protected]
http://www.blurredistinction.com/director
property isPlaying, strtFrame, curFrame, backwards
property isLooping, loopTot, curLoop
on getPropertyDescriptionList
pList = [:]
pList.addProp(#isPlaying, [#comment:"Begin play at start:",
#format:#boolean, #default:true])
pList.addProp(#backwards, [#comment:"Play backwards:",
#format:#boolean,
#default:false])
pList.addProp(#isLooping, [#comment:"Loop play:",
#format:#boolean,
#default:true])
pList.addProp(#loopTot, [#comment:"Loop x times (0 for
forever):",
#format:#integer, #default:0])
return pList
end
on beginSprite me
tell sprite(me.spriteNum)
curFrame = the frame
strtFrame = curFrame
end tell
curLoop = 0
end
on exitFrame me
if not isPlaying then
tell sprite(me.spriteNum) to go curFrame
else
if backwards then
prevFrame(me)
else
nextFrame(me)
end if
end if
end
on nextFrame me
tell sprite(me.spriteNum)
curFrame = curFrame + 1
if curFrame > the lastFrame then
curFrame = strtFrame
curLoop = curLoop + 1
if isLooping then
if curLoop = loopTot then
isPlaying = 0
end if
else
isPlaying = 0
end if
end if
go curFrame
end tell
end
on prevFrame me
tell sprite(me.spriteNum)
curFrame = curFrame - 1
if curFrame < strtFrame then
curFrame = the lastFrame
curLoop = curLoop + 1
if isLooping then
if curLoop = loopTot + 1 then
isPlaying = 0
end if
else
isPlaying = 0
end if
end if
go curFrame
end tell
end
on pausePlay me
ispLaying = 0
end
on playNormal me
isPlaying = 1
backwards = 0
end
on playBackwards me
isPlaying = 1
backwards = 1
end
Then you can do:
sprite(x).playBackwards()
sprite(x).playNormal()
sprite(x).pausePlay()
HTH
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/
Maybe you are looking for
-
Error while working with Calendar component
Hello there, I am receiving the following error whenever I want to modify data via a web form created with VWP and Netbeans 6.0. (The error text is as follows �form1:printEingDruck: An error occurred when processing your submitted information.�) The
-
Issues with wifi since updating to iOS 6 on iPad 3.
I'm having wifi issues since updating to iOS 6 on my iPad 3. I can't access certain sites and get error messages such as 'servor can't connect' and 'request timed out.' Although some sites work fine. I can't access apps which require internet such as
-
MRBR Report- Price and qty variance tables/structure/Function module
Hi I am in the process of developing a customised report similar to MRBR report. I am not very clear on the logic used for "Difference Qty" and "Difference Value". MRBR is taking values from strucrure ARSEG. Is anybody aware if there are any tables f
-
I am about to start this project where the background on a full browser flash site has a number of shapes. Ideally and I am not sure if this is even realistic, I would like the shapes to have a slight mouse interaction. While the mouse will respond t
-
Data base conversition utility
Hi all, what is the data base conversition utility ? Thanks in advance Sri...