LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub VI works alone, but not from an upper vi

The attached VI is designed to communicate with a servo motor via a RS232 port.  For the most part it works well, but I need a little help.

 

  1. How do I change the background of the front panel? I’m growing tired of “Puke Purple”.

 

  1. The serious problem is with the SM Tester bill 8-7-07 vi.  With the following “Move Parameters” (Front Panel) Velocity =5, Acceleration =5 and Position = 5;  Press the “Go” button, I expect the motor to stop when the “Axis Position” = 5.  To my dismay, the motor keeps rotating as the “Axis Position” goes from 0 to greater than 5.

 

Then I went to the block diagram. Inside the top “While Loop”  case “Go Button”  I opened the sub VI “SM Move”. Using the same move parameters, I ran this vi, the motor stops at axis position 5. If I change the “Position” to 0, the motor returns to 0. Works perfectly.

 

Why does the sub vi work, but not the main vi?

 

  1. Finally, I would like to understand why the block diagram (of the SM Tester Bill 8-7-07 vi) has two while loops in parallel. One loop has a case structure and the other has an Event Structure.  

 I've attached the vi and also the .llb Hope I did this right.

 

Thanks for your help,

 

Bill

Download All
0 Kudos
Message 1 of 4
(2,190 Views)

The color problem is simple to fix. There is a paintbrush tool on the Tools Palette. With 8.x, this is under the View menu. Just select the paintbrush and when you move to the front panel, right click to get a pop-up to select the color you want.

I could not run your VI because I kept on getting an error dialog. I hate it when the LabVIEW error dialogs are included in subVIs like they did here. One thing you can try is to right click on the subVI called in the GO case and select SubVI Setup and then select the Show Panel, Close Afterwareds, and Suspend options. That way the subVI will pause when called and you can view the settings on the panel and then run it to see what happens.

0 Kudos
Message 2 of 4
(2,167 Views)

When I right clicked the Sub VI, the "SubVI Node Setup" was grayed out.

So I went to "Help" and found your instructions plus these:

Complete the following steps to have every instance of a subVIs front panel open when called.

  1. Double-click the subVI to open it and select File»VI Properties to display the VI Properties dialog box.
  2. Select Window Appearance from the Category pull-down menu.
  3. Click the Customize button and place checkmarks in the Show Front Panel When Called and Close Afterwards if Originally Closed checkboxes.
  4. Click the OK button.
  5. Save and close the subVI.
  6. Run the top-level VI. Every instance of the subVI front panel opens when called.

The  Front Panel When Called and Close Afterwards if Originally Closed were also grayed out.

Is there something else that needs to be enabled?

 

Thanks,

 

Bill

 

0 Kudos
Message 3 of 4
(2,152 Views)
I didn't notice that you were using 7.1. Whoever wrote this driver decided for some reason, to make the functions in the driver reentrant. With 7.1, you have to first go to the VI Properties>Execution and uncheck the Reentrant Execution box. Prior to 8.2 (or maybe 8.0), a reentrant VI could not display it's front panel when called.
0 Kudos
Message 4 of 4
(2,137 Views)