06-14-2023 05:29 PM
Good afternoon Altenbach,
Please excuse my horrible code smell, beginner at all of this. The purpose of the VI is for the user to select a position on valve and it displays the changed position. The Tanks are not necessary, just wanted something to display change in volume when position is changed. Can you send an example I can work with using the VI I included??? What do you recommend time for timeout? Can I remove stop buttons? How do I change the resolution of timer? What is a proper state machine? I'm assuming VISA resource isn't a proper state machine and opening and closing loops. I need an example using the VI submitted to better understand, as you can tell I'm supper lost. Main issue is VI works but for some strange reason, randomly, the position selected doesn't correspond to the hardware position. It work with no issues but I originally notice the problem when I switched serial cable to ethernet. I have multiple serial to ethernet converters, so for troubleshooting purposes I bypassed with straight serial cable to serial to usb adapter connected to laptop on one end and the other end to valves. Please help, thanks in advance!!!
06-14-2023 06:33 PM - edited 06-14-2023 06:34 PM
Here's a quick modification for 1/3 of your code. It would be easy to add the rest in a similar way. (use the captions for the detailed headers). Position should maybe be an enum.
Since I don't have your hardware, I don't know if the instrument I/O is correct and I have blanked it out.
06-15-2023 06:27 AM
Thank you Altenbach, by adding this modification will VI open and close loop, preventing register shifting on hardware?
06-15-2023 07:58 AM
@Manny904 wrote:
Thank you Altenbach, by adding this modification will VI open and close loop, preventing register shifting on hardware?
Sorry, I have no idea what you are trying to say here. I am not a "hardware" guy and mostly focus on code architecture, not interactions with instruments. Take any of my advice as just that.
06-15-2023 09:08 AM
Thank you Altenbach,
I made the modification, replace hard ware. I apologize for the confusion, ran test with modifications and it passed.
06-15-2023 09:43 AM
Glad you got it working Manny!
If you get a chance, please select Altenbach's post as the solution for this thread. It helps us know when an issue is resolved so we can move on to help other users.
Clicking the Kudos button on posts that helped you is a nice way to say thanks too. 😉