LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dimetix laser communications

OK, let's try and take this apart and see where the failure is.  When you run your main vi with mine incorporated can open the front panel of my vi and see if it get's a reading at all?  If you see a measurement there we can go a bit farther.  If you don't then open the back panel of my vi, turn on highlighting and see what happens. Since my vi has an event structure I am not sure you are kicking things off without pushing a button. It seems like you have to be stuck in the event structure. If you want to post your actual code instead of a picture I may be able to help more efficiently.

0 Kudos
Message 11 of 17
(1,220 Views)
Your code violates every rule about dataflow. You have a subVI that has a loop that you can't stop unless you show its front panel. If you do stop it, you pass a single value to the next loop which runs continuously with that one value until you stop it. Then you run another loop that would continuously take the same image until you stop that. Then the entire VI stops.

Remove the loop from the subVI. Create a basic state machine with a single loop and the different states - get the distance, run the script, take an image. You would benefit from some basic LabVIEW tutorials.
0 Kudos
Message 12 of 17
(1,217 Views)

Ok so I tried to make a state machine, removing the while loop for the laser measurement but I must be wrong somewhere (even if I don't get errors, I acquire the distance but can't send it to the script).

 

Here are attached my VIs :

- Laser Single Meas is the one modified from Dave

- Calling Python script and Camera is my main VI (works great but I have enter by myself the distance to the object to focus the camera)

- Calling Python State Machine is the one with the state machine.

 

Baptiste

0 Kudos
Message 13 of 17
(1,207 Views)

 If you run your state machine vi with highlighting on you will see that you only go to the first state and just keep wrapping around. You never update the enum to move to the next state. Do you know what I mean by highlighting? Go to the backpanel, find the lightbulb and turn it yellow. It will slow the code down and show  you what is executing.

 

You need to find a state machine example and study it. The state machine template that comes with Labview is a good place to start. Go to File, New, and look at Design Patterns group and select the Standard State Machine.

 

Do you have any other programmers around that you can collaborate with? I don't want to offend you but it seems like  you could use some local guidance.  

0 Kudos
Message 14 of 17
(1,191 Views)

Hi Dave,

 

Yes I know what you mean with the highlight 🙂 I just forget to try it with the state machine. I could figure out where were my mistakes 🙂 It is almost working now.

I am a not a programmer (I do quantum physics) but I am the only one here who knows how to use Labview 🙂 I used to code with Labview Robotics for RIO competition in France last year 🙂

 

I think I have everything to debug my code now !

 

Thanks guys ! 

 

Baptiste

 

0 Kudos
Message 15 of 17
(1,186 Views)

Baptiste,

 

I'm integrating the DLS-B sensor and was attempting to use TypeCast for the EoL constant as a termination charactor when configuring the COM port, prior to opening it. 

 

The only way I can generate a response from the sensor is to concatenate the EoL character string to the commands. Could you explain why it works that way but not as a termination character? Apologies, I realize that this is quite an old thread but it's relevant to my current work. Thanks in advance!

 

 

 

Cheers,

Winston

0 Kudos
Message 16 of 17
(1,133 Views)

Hi Wintson,

 

I know your issue is related to the posts above, but it looks like this thread might be a little old, and has many different questions asked. I think it would be in your best interest to start a new thread to get your question higher visibility. Hope you get everything figured out!

 

Best Regards,

Will

0 Kudos
Message 17 of 17
(1,110 Views)