10-12-2023 02:28 PM
Hello folks,
Greetings of the day!
I have built VI logic for single laser diode but now I need to connect another one (totally 2 laser diodes) so how do I can make the changes in the VI logic. I am attaching the VI file for your reference. Please help me in this regard.
Your help will be highly appreciated.
Regards,
Madhusudan
10-13-2023 05:33 AM
You might get more if you save the VI to a previous version (20, or even 18)...
Without seeing your code, I'd say you should put what you have into subVIs, and make things work with an array (0..n) in stead of a scalar (1).
That's very generic advice, purely based on you posting 1 VI, and mentioning scaling up from 1 to >1.
10-13-2023 09:58 AM
I noticed you are using "Bytes at Port" in your serial communication.
I recommend you watch this video: VIWeek 2020/Proper way to communicate over serial
But I will assume that a second laser would be on a second Com port. So in general you would do the same thing but send the command to whatever com port the laser you want to control is on.
Also you might want to think about using a loop that waits for a command, sends the command, then waits again. That way you don't have to launch your program every time you want to turn one off or on.
10-13-2023 10:48 AM
Hello,
Please find the attached VI saved to previous version 19. Please do the needful.
Many thanks for your kind response.
I highly appreciate your support and help being provided.
Regards,
10-13-2023 10:52 AM
Hello,
Many thanks for your kind reply. I am grateful for you valuable suggestions. Could you please help me by updating the attached VI file and revert back with updated one. As I am beginner to LabVIEW and don't know most of things in LabVIEW. I am trying to learn and understand the things on this LabVIEW platform.
Please do the needful.
Many thanks for your kind help and support.
Regards,
10-16-2023 11:47 AM
10-16-2023 11:56 AM
10-17-2023 10:36 AM
Hello,
Greetings of the day!
Many thanks for your help. Could you please send me these files in NI Labview 22 or even lower version. As I am unable to open in my system. It would be a great help.
Regards,
10-17-2023 10:57 AM
You posted a VI that sends "cof" to serial port COM1 and reads back a response.
If you want to combine two of them, simply:
1) Create a NEW VI.
2) Drop TWO copies of "Test Laser.vi" on the block diagram and you will have TWO VISA controls and TWO string indicators (BTW, learn to ALWAYS label you controls and indicators!).
3) Set one port to COM1 and the other to COM2 (or whatever port you connected).
4) Run the new VI.
That's it.
10-17-2023 11:04 AM
I just noticed you didn't even hook up your connector pane. You should do that and add error in and error out terminals so you can use your VIs as SubVIs.
If you don't know how to do that, you should stop coding and read the basic LabVIEW tutorial before you continue. Especially if the laser is above a few milli-watts. 🤕