08-04-2014 11:54 AM
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.
08-04-2014 12:00 PM
08-04-2014 12:53 PM
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
08-04-2014 04:53 PM
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.
08-04-2014 05:11 PM
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
04-04-2016 12:14 PM
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
04-05-2016 12:39 PM
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