sjukheter Posted March 14, 2011 Report Share Posted March 14, 2011 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 Quote Link to comment
bmoyer Posted March 14, 2011 Report Share Posted March 14, 2011 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 Quote Link to comment
sjukheter Posted March 14, 2011 Author Report Share Posted March 14, 2011 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. Quote Link to comment
bmoyer Posted March 14, 2011 Report Share Posted March 14, 2011 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 Quote Link to comment
sjukheter Posted March 14, 2011 Author Report Share Posted March 14, 2011 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. Quote Link to comment
bmoyer Posted March 14, 2011 Report Share Posted March 14, 2011 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. Quote Link to comment
ShaunR Posted March 14, 2011 Report Share Posted March 14, 2011 Also...... you need to put the boolean control terminals inside of the case for that control otherwise when you press them they will not pop back to thier FALSE state. e.g Quote Link to comment
sjukheter Posted March 14, 2011 Author Report Share Posted March 14, 2011 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 Quote Link to comment
bmoyer Posted March 14, 2011 Report Share Posted March 14, 2011 Also...... you need to put the boolean control terminals inside of the case for that control otherwise when you press them they will not pop back to thier FALSE state. e.g Thanks Shaun. This was also stated in entry #2. Quote Link to comment
ShaunR Posted March 14, 2011 Report Share Posted March 14, 2011 Thanks Shaun. This was also stated in entry #2. You don't expect me to read threads do you? Apologies. He's all yours 1 Quote Link to comment
jgcode Posted March 15, 2011 Report Share Posted March 15, 2011 You don't expect me to read threads do you? Apologies. He's all yours lol Quote Link to comment
bmoyer Posted March 15, 2011 Report Share Posted March 15, 2011 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? Apologies. He's all yours That's funny. No, you can have him/her. rajnew 2.vi Quote Link to comment
sjukheter Posted March 20, 2011 Author Report Share Posted March 20, 2011 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.