LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I make LavVIEW run faster?

hi there

your app sends 2 bytes ("@\n") per shot, so at a rate of 300 baud this takes at least 50 ms plus overhead -> max rate 20 Hz! if you increase the baud rate the app will run faster. see the attached simplified code. it shows the time between two shots in a chart. change the value of the baud rate in the diagram and see what happens.

as MattH mentioned in his post put hardware configuration OUTside loops. and always CLOSE hardware devices....

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 11 of 28
(1,803 Views)
I tried to copy what you did, but i can't get the wires to connect properly through the case structures.  I keep getting error messages along the lines of:  "You have connected a scalar type to an array of that type."  I also notice that you have shift registers inside your for loop and I don't.  Is that my problem, and if it is, how do I put them in there?
0 Kudos
Message 12 of 28
(1,788 Views)
It would be a problem if you didn't have them.  Right click on the loop tunnel, and select "replace with shift register".

Looking at the code I'm not sure where you're running into the scalar to array error (the code chrisger posted that is).

If you want to post what you've got, feel free!

Message Edited by Novatron on 07-11-2006 11:09 AM

0 Kudos
Message 13 of 28
(1,780 Views)

hi there

first step is always a right mouse click: right click on the frame of the loop and select "Add shift register". to tunnel a scalar through a structure (loops, cases..) right click on the tunnel and select "disable autoindexing", to build a array out of scalars right click on the tunnel and select "enable autoindexing".

search for "autoindexing" in the "VI, function & How-To" help of your LV installation or play around a little bit.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 14 of 28
(1,777 Views)
I have the VI running with the instrument configuration and the close session outside the while loop. 
With the baud rate set at 300, I did not see a difference.
When I changed the baud rate to 9600, the limit shifted from about 10Hz to about 330Hz.
I continued to change the baud rate until it managed 1kHz, which occurred at a baud rate of 56k.
Unfortunately, my only option with the SDG box is the RS232 port, which means my baud rate is limited at 9600.
Is there anything else I can do to try to make the VI run faster, or am I stuck with a frequency of about 330Hz?

Message Edited by anjie on 07-11-2006 10:49 AM

0 Kudos
Message 15 of 28
(1,761 Views)
Who makes and what model number is the laser? Any documentation on the SDG box you speak of. Some lasers use analog voltage or digital PWM to control power, this could be a possibility.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 16 of 28
(1,749 Views)
I'm not sure that controlling the power is exactly the route my superiors want to go. 

Right now, the SDG box has two modes:  one is "continuous mode" in which the laser outputs a continuous stream of pulses at 1000 pulses per second until you tell it to stop; the other is "single shot mode" in which the laser outputs one pulse each time you tell it to.  There is no in between.  It is possible to control the SDG box from a remote instrument via an interface (e.g. LabVIEW)--everything that you can do manually through the SDG box can be done remotely through the interface.  All I want to do is send a command that instructs the SDG box to output a single pulse, BUT I want to be able to vary the frequency at which that command is sent to the SDG box, thereby varying the frequency at which pulses are output by the laser.  Unfortunately, the only port on the SDG box through which we can communicate with it is an RS232 port, which limits us to the 9600 baud rate.  All of that said, I have no idea how controlling the power would allow us to vary the frequency of the pulses. 

But to give you as much information about that laser that I have at this moment:  it was manufactured by Coherent, there is a Mira seed laser which feeds into a Verdi pump laser which is the base beam for the LegendTi:Sapphire laser while the Evolution is the pump beam for the Ti:Sapphire crystal inside the Legend. 
0 Kudos
Message 17 of 28
(1,733 Views)
The lasers I play with are quite a bit different than the Verdi lineup.
 
I went to Coherent's site, not too much info on the SDG -BUT- I do see it has an external trigger input. I presume this is used to pulse the laser. What I am thinking you might be able to do is set up the SDG via serial port to use the trigger input. Then use a DAQ card with a counter/timer function to fire the trigger at varying rates to control your pulse rate.
 
I would suggest you contact Coherent directly about what you are trying to do and see if the above would be feasible.
 
BTW- they do have LabView drivers for the SDG, in case a future user comes along this way.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 18 of 28
(1,725 Views)
Just a thought that might speed it up a little...

Do you really need to send each '@\n' individually?
Could you send, say 10 commands in one write '@\n@\n@\n@\n@\n@\n@\n@\n@\n@\n'? or even higher increments...

In theory this could speed up the rate... but it depends on the resolution you need. Do you really need this much control?
0 Kudos
Message 19 of 28
(1,716 Views)
Since your resulting frequency seems to scale pretty linearly with serial baud, I think your problem may be with buffer size.  I do not know what buffer size LV uses as its default in your application, but I suspect it is more than is required for the three ASCII characters your are transmitting.  The VISA write may be taking longer than expected because it transmits the entire buffer, even if large portions of it is unpopulated.

I do not have the hardware to test my theory, but it may be worth a shot.

Message Edited by jasonhill on 07-11-2006 01:26 PM

0 Kudos
Message 20 of 28
(1,709 Views)