LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error wire in visa--how many

If I have 3 visa sessions open, is it necessary to have a separate error wire for each one or can i just split the wire? Or is this decided on a case-by-case basis depending on what you want to do with your program?
0 Kudos
Message 1 of 14
(3,041 Views)

Do you have portions of the code running in parallel? 

If your code is executed in sequence, then you should not split your error cluster wire.

 

You can always post your code (or a screen capture .png) to show us what you mean.

 

R

0 Kudos
Message 2 of 14
(3,040 Views)

Yeah, I will. It is just a bit of a mess as of now so im trying to clean it up :smileysad:

 And yes, it is in parallel

Message Edited by for(imstuck) on 03-11-2009 09:43 AM
0 Kudos
Message 3 of 14
(3,034 Views)

If you have parallel threads of code, then yes, split the error cluster wire for each parallel thread.  You then re-combine them using the Merge Error function.  I think it is located within the dialog section of the Functions Palette.  Sorry, I do not have LV installed on this PC, so I cannot accurately guide you to its location.  You can do a search (top right of Functions Palette) for Merge Error (or simply "Error").

 

R

0 Kudos
Message 4 of 14
(3,028 Views)
Here is an image since you don't have lv installed but you can take a look at it hopefully at let me know what I can combine. I will try your suggestions on my own also. If anyone has suggestions about my queue I'd appreciate it. I haven't used one before so I'm not sure if im using it correctly/there is a better or more efficient way to do stuff, etc. Basically my program will either open or close a shutter, open it for a set exposure time then shut it, or it will record data while changing the light wavelength. Thanks in advance as always for help. Ignore my mess of a block diagram 🙂 still working on fixing that.
0 Kudos
Message 5 of 14
(3,023 Views)

You should only have a single Error In at the left of the diagram and a single Error Out to the right of the block diagram.

Also, within your While Loops, you should only have 1 error cluster line.  I'll edit the image to show where / what I mean.

 

You are using 2 optical power meters.  Do you really want to read them at (nearly) the same time? If so, you may want to make sure that the sub-vi's are set to re-entrant.  If that is the case, then yes, you would split the error cluster wire before and recombine after the OPM configure & read, all within he while loop.

 

I'll go make comments on the image.

 

Be back soon

 

R

 

PS:  The code looks familiar.  You obviously work in Photonics.  Which country / state / province are you located?  Just curious.

 

 

Message 6 of 14
(3,004 Views)

Here is your modified image with comments. 

Doing so will already help to clean up some unwanted wires.

 

R

 

 

Message Edited by Ray.R on 03-11-2009 12:51 PM
Message 7 of 14
(3,002 Views)

Additional comments:

 

For an event structure loop, if you use it to respond to operator events (ie: push a button with mouse), you do not need to wire the -1 value.  You also shouldn't use the 200ms delay.  Each iteration will wait for an event to happen, so no need for the delay.

 

The top look shouldn't be to generate user events (as indicated by your comment at the bottom), but rather to handle user events.  The "Start Scan" button should be one such user events.  But, that would mean changing your architecture, because it looks like you want the bottom loop to run continuously..

 

You may not need to have a seperate loop to plot the data from queue.  I can't see the code.  I suspect you want to update the plot for every measurement that you take.

 

Can you describe the overall picture of what the application does?  There may be ways to simplify the code further.

 

R

Message 8 of 14
(2,998 Views)
I actually do need the -1 because if someone pushes a button to take a picture, I want the shutter to open for a certain exposure time, then after that time is up, go into the timeout case and shut the shutter. However, I don't want the time out case to continuously run on every loop iteration because it will continually send the close shutter command, even if the shutter is already closed. thats what the case structure in the top loop takes care of. It's hard to tell with an image. I will take your suggestions and fix things tomorrow then get back to you. Thanks again for all your help
Message Edited by for(imstuck) on 03-11-2009 12:53 PM
0 Kudos
Message 9 of 14
(2,975 Views)

If you post your code, I'll be able to look at it in the evening.

 

R

0 Kudos
Message 10 of 14
(2,964 Views)