Jump to content

event structure help


Recommended Posts

Hi,

I was struggling with event structure that in my program first, I want to display all the available addresses in dropdownlist and then user can select any one of the available addresses plus any of the other available buttons (terminal or monitoring options). The problem is after getting the all available address the program is closing itself without waiting for the other events. How can I slove this. Please some suggest me.

rajnew.vi

Link to comment

Do you see an error when you get addresses?

I'm not sure wait device this is for, but there's a couple of things I see.

You probably want to enable a termination character (settable when initializing (VISA Configure Serial Port)) as an easy way to know when your device is done sending characters. Hopefully your device uses a termination character. If it does, just wire a large number to the byte count input of the Serial Read and it will return as soon as the termination character is received.

Your use of the dropdownlist is incorrect. Create a property node with property of Strings[] and wire the output of the serial read to the property with the property outside of the for loop.

Consider changing the mechanical action of the buttons so that they automatically return. Right-click on the button and under mechanical action select latch when released. Move the button into its event (the button must be read in order to return).

If you are considering making this a more robust program, consider looking into state machines so that your program doesn't terminate when it receives an error.

Bruce

Link to comment

Do you see an error when you get addresses?

I'm not sure wait device this is for, but there's a couple of things I see.

You probably want to enable a termination character (settable when initializing (VISA Configure Serial Port)) as an easy way to know when your device is done sending characters. Hopefully your device uses a termination character. If it does, just wire a large number to the byte count input of the Serial Read and it will return as soon as the termination character is received.

Your use of the dropdownlist is incorrect. Create a property node with property of Strings[] and wire the output of the serial read to the property with the property outside of the for loop.

Consider changing the mechanical action of the buttons so that they automatically return. Right-click on the button and under mechanical action select latch when released. Move the button into its event (the button must be read in order to return).

If you are considering making this a more robust program, consider looking into state machines so that your program doesn't terminate when it receives an error.

Bruce

I tried to create property node in strings but the problem is I Am using local varible of the dropdownlist in other event cases because of selected address should written to port in other event cases. Please can make it for me and the attched Vi is above. I am using labview 8.5. I guess that i have taken string dropdownlist but I need to display hex numbers in dropdown list. Please make me out of this.

Link to comment

I tried to create property node in strings but the problem is I Am using local varible of the dropdownlist in other event cases because of selected address should written to port in other event cases. Please can make it for me and the attched Vi is above. I am using labview 8.5. I guess that i have taken string dropdownlist but I need to display hex numbers in dropdown list. Please make me out of this.

The local variable outputs what the selected value is which is what you need for the events that send the selected value. The "Get available addresses" event just initializes the pulldown with all of the selectable values.

Does your device have response termination character(s) so that you can more robustly control the communication?

Bruce

Link to comment

The local variable outputs what the selected value is which is what you need for the events that send the selected value. The "Get available addresses" event just initializes the pulldown with all of the selectable values.

Does your device have response termination character(s) so that you can more robustly control the communication?

Bruce

No, i did not check with the device though My task is to finish this. Could you please help me that you told some thing about property node setting in the first message ..Please I am running out of deadline. Please can tell me exactly hoe can i do that.

Link to comment

No, i did not check with the device though My task is to finish this. Could you please help me that you told some thing about property node setting in the first message ..Please I am running out of deadline. Please can tell me exactly hoe can i do that.

This is all you need to do to get the pulldown menu items (see image). I told you exactly how to do it.

post-4985-0-60358400-1300129643_thumb.pn

Link to comment

This is all you need to do to get the pulldown menu items (see image). I told you exactly how to do it.

Yes, I was thinking the same but if connect read terminal to property node like what you showed. Next, Can I delete existing indicator on that place(PMBus address) after connecting to the property node of PMBus indicator. In that case, it delets existing property node also and i have left it alone there after. Is this right?

I have one more doubt about enable and disable indexing. As i am new to programming and difficult for me to undestand. can you help me, In waht cases we use these option. Since, I was just using trail and error methods in the case of errors. I want to know what exactly it is? see the attachment, hopefully i changed all things. Is it ok now, then i will check with device later and may i can troubleshoot some other problems.

rajnew.vi

Link to comment

Yes, I was thinking the same but if connect read terminal to property node like what you showed. Next, Can I delete existing indicator on that place(PMBus address) after connecting to the property node of PMBus indicator. In that case, it delets existing property node also and i have left it alone there after. Is this right?

I have one more doubt about enable and disable indexing. As i am new to programming and difficult for me to undestand. can you help me, In waht cases we use these option. Since, I was just using trail and error methods in the case of errors. I want to know what exactly it is? see the attachment, hopefully i changed all things. Is it ok now, then i will check with device later and may i can troubleshoot some other problems.

No, don't delete the indicator, because that will make the property node not work. Actually, I think your indicator should be a control (right-click on the pull-down menu on the front panel and select Change to Control) so that the user can select it.

You don't expect me to read threads do you? tongue.gif

Apologies. He's all yours biggrin.gif

That's funny. No, you can have him/her.

rajnew 2.vi

Link to comment

No, don't delete the indicator, because that will make the property node not work. Actually, I think your indicator should be a control (right-click on the pull-down menu on the front panel and select Change to Control) so that the user can select it.

That's funny. No, you can have him/her.

I am just expecting to work my program in below manner.

start with given VISA resource name and then it wait for event. 0ms is my timeout case which enters into the case and performs the task. I am expecting that after finishing the tmeout case, it should wait for other events to happen unlike now i guess it will close the session. I want to make it as to wait for other event after finishing the first case. I don't know wether it will work as what i am expecting or i need to do any more for that. Please suggest me.

rajnew.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.