08-17-2017 07:16 PM
Hi,
I'm new on LV and i'm having trouble with my instruments and how to merge the drivers I have. I need one application to a spectroscopy experiment. I have a Horiba Monochromator which have a labview driver (MoCo) and a Thorlabs PM100D, which also has a source code included, to acquire the power of light.
I need to start the monochromator scan (which will run 1 nm/s) and the power measurement aquisition of the Thorlabs meter (1 scan/s) at the same time. The two instruments have your particular "start" button and the control to change this integration time. My idea is to control these numbers in the same front panel, and start the two functions at the sime time, to synchronize the present power with the respective nanometer of the source light.
I tried many things, but without success. First, a tried to run the two full applications (the source codes have many many subVIs and i don't know how to use then separately too) in one custom application with some references and put some "control refnum" to control these subVIs in my panel, but nothing happened. Someone can help with ideas?
Thanks!
08-17-2017 07:52 PM
The best way for us to help you is for you to post your current code so that we point out any ideas and suggestions.
08-17-2017 10:44 PM
I would use an User Event to command both apps to start running. This does assume both are using an Event Structure for the GUI.
08-18-2017 01:53 AM
Hi,
Why not using Notifiers?
See exemples in LabVIEW.
Best regards.
08-18-2017 02:12 AM
Hi,
I think that you need some common clock source to run these task simultaneously.
I find something that could help you find some examples:
M Series Synchronization
Have a nice day
Martin
08-18-2017 07:11 AM
Without seeing the code (as noted by tyk007), it is nearly impossible to make a meaningful suggestion. You presumably want to do more than start two different functions of two different instruments at the same time, but rather to synchronize their behavior in some way. Doing this requires some knowledge of how each "clocks" itself, and whether you can get them to "share" a clock. Depending on the level of complexity of each routine by itself, it might be better (meaning "quicker to code", "more likely to work", "easier to debug and maintain") to "start over" and design, explicitly, a routine that takes both instruments (and their differing Support Routines) and designs them to work together.
Bob Schor
08-18-2017 08:46 AM
Hello!
Thanks for reply. You and tyk007 are right, i should had uploaded my code!! I am sending the code now with the two original VIs. Mono is the monochromator control and the another is the meter control. In the panel I put the buttons I want to control. I have erased the modifications that I made because I think is better to think with the instruments original code.
Have a good day.
08-18-2017 08:51 AM
Thanks for the reply!
I have readed about this, but I can't realize how to do this with two another internal buttons of my VI's.
08-18-2017 12:48 PM
I'm sorry to tell you that the code you attached is pretty useless to helping us to understand your question and your problem. It consists of 7 controls, two unknown VIs, and a While Loop with a Stop Control -- the only wiring involves the Stop Control.
I think I'd recommend that you find a local LabVIEW Expert and hire her (or him) to help you. Alternatively, you could take all of the code and routines you are using, put them in a folder, compress ("Zip") the folder, and attach the Zip file. Be sure that we understand what action you would like to see -- what do you want the buttons to do? [Right now, they do absolutely nothing, which is, of course, very easy to program, indeed, you've already done it ...].
Bob Schor
08-21-2017 02:40 PM
Hi Bob_Schor,thanks for your reply, and sorry for the code!!!
I attached the wrong code! This code only have the two VIs of the instruments. Sorry about this. And about the other files, I will explain what is going wrong:
I can't pass the comands to "MoCo" subVI. I put the buttons on my front panel, but when i run this app, I only can change things in MoCo by clicking on the subVI (which is running always). The my problem is how to pass settings of "my panel" to a SubVI which have your subVIs. I only tried to edit MoCo's Connector Pane, but with this, nothing changes.
Besides that, which is essential, another problem is: I need the button "Start Scan" to start the monochromator movement and, at the same time, i need to start the power meter (PM100D) to collect every power measure of your respective wavelenght set in the MoCo.
I tested this code(with many otherfunctions) with numbers, without using the instruments, and it works! Then, i am lost in how to send controls to a subVI in my VI.
Greetings!