05-18-2016 04:42 AM
Hi, I am working to communicate with a Como torque sensor. My program is working perfectly.
I need to create a sub VI of my program and once I do it, half of the program is not running anymore.
You will find attached the program. I meant when I use my program as a sub Vi and I am trying to define the range the subvi is working but when I am starting the measure I am not getting any value in my indicator but my program (orange) is running on behalf like shown in the picture.
any ideas or suggetions please?
05-18-2016 05:08 AM
Hello,
What do you mean you need to use your program as SubVI?
If you encapsulate the entire program as is, you won't have information display in the Main VI or control the execution unless you wire those indicators from the subVI to the main VI.
I suggest you create a subVI with a state machine to configure your measurement, and another subVI to acquire the data,
You could use a event case in the top level VI to configure the communication, then to setup the measurement and once its connected, it could read data in the timeout.
05-18-2016 06:58 AM
Hi,
thanks for your answer and help.
I meant that I want to use it as a block as in the folder attached.
I didnt get what you mean by sub Vi with a status machine.. Could you please provide me a folder or more explanation?
05-19-2016 09:00 AM
Hi again, I have done like you asked.
I divided my program on 2 programs one for start the measurement and one to define the range. But It's the same thing; the define range is working perfectly but the SubVI start measurement is not as shown in the screenshot
You will also find attached the two programs.
Any suggestion please? I am struggling here since 2 days
05-19-2016 09:10 AM
You need to review some labview programming concepts such as SubVis.
I am sending the corrected code.
Good luck with your measurements.
Let me know if you suceed in getting the measures.
05-19-2016 09:18 AM
Hi, I can not see your code cause I am using the 2014 version of Labview :S
Is it possible to change the version? or to make a screen shot please?
05-19-2016 09:22 AM
Data Flow!
You are calling a subVI that has a while loop in it. It will not return until someone hits the stop button inside of it. If you don't show the front panel, then no one is going to see it and be able to hit that button.
I would recommend you learn more about LabVIEW from here. How to Learn LV
05-19-2016 09:23 AM
Sure.
I have converted the files to 2014 and also took a screenshot.
Sub VI
05-19-2016 09:26 AM - edited 05-19-2016 09:28 AM
Marwah,
You can eliminate all of those Timeout property nodes scattered throughout the subVI. There is no need to continually set the timeout to the same value. Doing it once at the beginning of the VI by using the timeout input to the Configure Serial Port will work just fine.
I would also put the carriage return and linefeed into the string constant itself (turn on \codes so they are visibile). Then you can get rid of the extra constants and the concatenate string.