LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program: Implementation of lowlevel protocol/general subpanel questions

I'm working on an interface for a school project and although I have knowledge of LabVIEW I just don't know enough to make the interface solely on my skills. So I have gathered some questions regarding the realisation of the interface here. General pointers (like: look at that example or check that function) are the anwsers I'm looking for, I do not expect (nor want) you to write the program for me. If I have any problems I will ask for clarification.
 
First some general background information: The interface uses several subpanel's (in each subpanel I have placed a submenu) and it communicates with a microcontroller through the RS232 standard.
 
Questions:
  1. How do I pass data from the subpanel vi to the main vi (where it will be send by a VISA write program)?
  2. I want to implement a lowlevel protocol for the RS232 communication (which is located in the main vi): tips on implementation?
  3. When the program is starting I would like to start with a "enter password here" type of screen. Can I do this by making the password entering the first vi (for the subpanel control)?
  4. When a certain subpanel is chosen: I want the program to request the data through RS232 and initialize the vi with that data.

If you have questions: please ask them and I will try to clearify as soon as possible.

0 Kudos
Message 1 of 9
(3,731 Views)
1: How do I pass data from the subpanel vi to the main vi (where it will be send by a VISA write program)?

In the subvi, go to the front panel and right click the icon in the top right corner, click 'show connector' and essentially wire the inputs and outputs to your subvi to that connector icon. That's how you can connect the ins and outs to the subvi to the block diagram of your parent vi.

2: I want to implement a lowlevel protocol for the RS232 communication (which is located in the main vi): tips on implementation?

Check out VISA, it is pretty straight forward.

3: When the program is starting I would like to start with a "enter password here" type of screen. Can I do this by making the password entering the first vi (for the subpanel control)?

If you go into the properties of the subvi (file >>VI properties) and under Window appearance, you can edit what happens with the subvi when it executes, you want to select dialog (but I suggest poking around a bit, just to check it out)



Hope that helps you get started.
0 Kudos
Message 2 of 9
(3,720 Views)


@Britoa wrote:


In the subvi, go to the front panel and right click the icon in the top right corner, click 'show connector' and essentially wire the inputs and outputs to your subvi to that connector icon. That's how you can connect the ins and outs to the subvi to the block diagram of your parent vi.


I'm not working with subvi's in the main vi. But My explanation is most likely the reason for this misunderstanding. I have included a picture of the block diagram (Subpanel.jpg) which shows the block diagram of the vi. I was thinking I would need some sort of node. Which could also be used (perhaps) to send data to a subpanel vi (and initialise it with that data).


@Britoa wrote:


Check out VISA, it is pretty straight forward.


I have and I'm not sure how I can implement a low level protocol with it, I was thinking that some sort of sequence would be in order.


@Britoa wrote:
3: When the program is starting I would like to start with a "enter password here" type of screen. Can I do this by making the password entering the first vi (for the subpanel control)?

If you go into the properties of the subvi (file >>VI properties) and under Window appearance, you can edit what happens with the subvi when it executes, you want to select dialog (but I suggest poking around a bit, just to check it out)

I have poked around in the VI properties, but the password feature there only blocks adjusting the front or block panel. It doesn't "request" a password to start the program (or give a user acces to it's functions).

Thank you Britoa for your responses, they helped me clarify some things.

New question: Is it possible to point the VISA serial blocks to a USB port (which has a cable in it that converts USB to serial)? 

0 Kudos
Message 3 of 9
(3,688 Views)
If you are placing a VI inside a subpanel you don't automatically have access to its connector pane. To pass data to and from a subpanel VI you have to use a combination of techniques. First open a reference to the VI that is usable by the Call by Reference Node. Next, pass this reference to the subpanel's Insert VI method. This places the VI in the subpanel. Finally, pass the reference to a Call by Reference Node this runs the VI and gives you access to the VI's connector pane for passing data.

Alternately, you can open a reference to the VI and use it to call the VI methods for setting individual control values, then run the VI and place it in the subpanel.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(3,675 Views)


@mikeporter wrote:
If you are placing a VI inside a subpanel you don't automatically have access to its connector pane. To pass data to and from a subpanel VI you have to use a combination of techniques. First open a reference to the VI that is usable by the Call by Reference Node. Next, pass this reference to the subpanel's Insert VI method. This places the VI in the subpanel. Finally, pass the reference to a Call by Reference Node this runs the VI and gives you access to the VI's connector pane for passing data.

So, I would place a Call by Reference before and after the Insert VI [see the attached image for a clear view of the Block diagram]? Does this run continuously?

If I implement this in the main vi (and with regard to the passing of data through RS232): The main reception/transmission of RS232 is done in the main vi, but the processing of the data is done in the subpanel vi (after the main vi has discovered the destination of the data). Is this correct or am I still missing something?

Thanks for the reply mikeporter.

0 Kudos
Message 5 of 9
(3,651 Views)
The call by reference has to come after the insert VI. The point is that you need to open a properly typed VI reference that will work with the call be reference.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 9
(3,632 Views)

Thanks for the clarification mikeporter, I'll try it out.


@Vraagteken wrote:

New question: Is it possible to point the VISA serial blocks to a USB port (which has a cable in it that converts USB to serial)? 


I did a test today: I connected a usb to serial connector, installed the drivers and ran the basic serial comm vi. I got the following error: Error 1073807253. Which is a framing error. Due to my inexperience with LabVIEW regarding VISA error messages: any suggestions for solving this problem?
0 Kudos
Message 7 of 9
(3,615 Views)

Hello Vraagteken,

You can maybe have a look at this articles :

http://digital.ni.com/public.nsf/allkb/F3E0621CB71AA16786256F970000FC57?OpenDocument

http://digital.ni.com/public.nsf/allkb/13A20C0F9DF265FB86256FC60066D9C2?OpenDocument

hope it will help you !

Regards,

Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 8 of 9
(3,560 Views)
Thanks for the reply julien.roland, I had already gotten a similar reply in another post. I have yet to retest the hardware.
0 Kudos
Message 9 of 9
(3,551 Views)