chocobar Posted November 13, 2008 Report Share Posted November 13, 2008 I need help over here...the problem that lies with my VI is that when i run it, it will continue on sending out sms to the phone number repeatedly...my problem now is that i need to make the VI to send out only once when its being triggered...anyone have a solution??? Quote Link to comment
dannyt Posted November 13, 2008 Report Share Posted November 13, 2008 QUOTE (chocobar @ Nov 12 2008, 06:32 AM) I need help over here...the problem that lies with my VI is that when i run it, it will continue on sending out sms to the phone number repeatedly...my problem now is that i need to make the VI to send out only once when its being triggered...anyone have a solution??? Maybe I am going mad, I cannot see any reason that this VI would be repeatedly sending a message, unless you were calling it repeated from above, you are pressing the Run button and not the Run Continuously button (just asking). The layout could be better, the need for the outer case I cannot figure out, and there is a lot of hidden wire under the outer case statement between the tunnel and the SMS string indicator hope this is some help Dannyt Quote Link to comment
TobyD Posted November 13, 2008 Report Share Posted November 13, 2008 QUOTE (chocobar @ Nov 11 2008, 10:32 PM) I need help over here...the problem that lies with my VI is that when i run it, it will continue on sending out sms to the phone number repeatedly...my problem now is that i need to make the VI to send out only once when its being triggered...anyone have a solution??? I vote with Danny on this one. You must be calling the VI more than once. Quote Link to comment
chocobar Posted November 19, 2008 Author Report Share Posted November 19, 2008 QUOTE (dannyt @ Nov 12 2008, 12:32 PM) Maybe I am going mad, I cannot see any reason that this VI would be repeatedly sending a message, unless you were calling it repeated from above, you are pressing the Run button and not the Run Continuously button (just asking).The layout could be better, the need for the outer case I cannot figure out, and there is a lot of hidden wire under the outer case statement between the tunnel and the SMS string indicator hope this is some help Dannyt lol...thats what im facing too...i can go mad because of this...my target is to run this thing continously and when it triggers...the sms system will be activated and thus send out 1 email to respective numbers...i still cant figure it out...HELP!!!! QUOTE (chocobar @ Nov 18 2008, 12:43 PM) lol...thats what im facing too...i can go mad because of this...my target is to run this thing continously and when it triggers...the sms system will be activated and thus send out 1 email to respective numbers...i still cant figure it out...HELP!!!! oopss...sry not email....its supposed to be msges... Quote Link to comment
TobyD Posted November 19, 2008 Report Share Posted November 19, 2008 QUOTE (chocobar @ Nov 18 2008, 04:50 AM) my target is to run this thing continously and when it triggers...the sms system will be activated and thus send out 1 email to respective numbers Can you clarify run this thing continuously? What do you mean by that? Are you starting the VI with the Run Continuously button? Post the code of how/where you are calling the VI that you posted previously and I think we'll be able to help you. -Toby Quote Link to comment
asbo Posted November 19, 2008 Report Share Posted November 19, 2008 QUOTE (TobyD @ Nov 18 2008, 11:52 AM) Are you starting the VI with the Run Continuously button? That's the first thing I thought of when I read through this. It's a reasonable enough mistake ... if you've never used LabVIEW before :> I think what he's really looking for is a finite state machine. Quote Link to comment
chocobar Posted November 20, 2008 Author Report Share Posted November 20, 2008 QUOTE (TobyD @ Nov 18 2008, 04:52 PM) Can you clarify run this thing continuously? What do you mean by that? Are you starting the VI with the Run Continuously button? Post the code of how/where you are calling the VI that you posted previously and I think we'll be able to help you.-Toby im trying to say that my VI will be running 24hrs...and yes i started the VI with the Run Continuously button... Quote Link to comment
TobyD Posted November 20, 2008 Report Share Posted November 20, 2008 QUOTE (chocobar @ Nov 18 2008, 06:59 PM) im trying to say that my VI will be running 24hrs...and yes i started the VI with the Run Continuously button... With the VI that you posted, your trigger will always be true (0+0=0 --> True) so if you set to "run continuously" your vi will run, send the message and then start all over again. The "run continuously" button is generally only useful for debugging and should not be relied on for a permanent solution. You need to build some code around this VI that keeps it running and passes it a legitimate trigger. A simple example is shown below. Original Modified Quote Link to comment
chocobar Posted November 25, 2008 Author Report Share Posted November 25, 2008 QUOTE (TobyD @ Nov 19 2008, 03:18 PM) With the VI that you posted, your trigger will always be true (0+0=0 --> True) so if you set to "run continuously" your vi will run, send the message and then start all over again. The "run continuously" button is generally only useful for debugging and should not be relied on for a permanent solution.You need to build some code around this VI that keeps it running and passes it a legitimate trigger. A simple example is shown below. Original Modified the vi that i post is an example for a given condition...i did try to put a while loop but still it will continue on sending message... im gonna use USB DAQ to acquire a signal from the thermistor and from there it will trigger the vi...i tried and when it stays on a certain temperature...it will continue to keep on sending sms... like for example i set the trigger condition to be activated at 37... when 37 is being displayed throughout...it will keep on sending out sms... my problem now is to make sure that when it remain constant...it wont send multiple messages...i want it to be send out once... if you guys want me to post what i did i can upload it here... Quote Link to comment
asbo Posted November 25, 2008 Report Share Posted November 25, 2008 QUOTE (chocobar @ Nov 24 2008, 07:00 AM) the vi that i post is an example for a given condition...i did try to put a while loop but still it will continue on sending message...im gonna use USB DAQ to acquire a signal from the thermistor and from there it will trigger the vi...i tried and when it stays on a certain temperature...it will continue to keep on sending sms... like for example i set the trigger condition to be activated at 37... when 37 is being displayed throughout...it will keep on sending out sms... my problem now is to make sure that when it remain constant...it wont send multiple messages...i want it to be send out once... if you guys want me to post what i did i can upload it here... I see your problem. What I would do is use a feedback node or shift register initialized to a FALSE boolean. Once you hit the trigger case where the SMS is sent, set that boolean to TRUE and then add conditional code that won't send the SMS if that boolean is true. In the opposing case that is executed whenever the trigger condition isn't met, set the boolean to false. You could go really overboard and use timestamps to track when the last SMS was sent and if it was within x minutes, skip this trigger. Quote Link to comment
BrokenArrow Posted November 26, 2008 Report Share Posted November 26, 2008 QUOTE (TobyD @ Nov 19 2008, 10:18 AM) http://lavag.org/old_files/monthly_11_2008/post-8758-1227107833.png' target="_blank"> I apologize for this being tangential, however: why use the Open Visa before the Setup? Quote Link to comment
TobyD Posted November 26, 2008 Report Share Posted November 26, 2008 QUOTE (BrokenArrow @ Nov 25 2008, 07:29 AM) I apologize for this being tangential, however: why use the Open Visa before the Setup? My point here was just to demonstrate the while loop. I kept his original code unchanged (other than running the diagram cleanup tool on it). That said, the VISA driver used to require a VISA Open at the beginning of a program. It was later changed so that the driver would automatically open a VISA reference if it needs one. So, it is not even necessary to have it in there at all - although it is probably still a good practice from a readability point of view. Quote Link to comment
BrokenArrow Posted November 26, 2008 Report Share Posted November 26, 2008 QUOTE (TobyD @ Nov 25 2008, 11:14 AM) My point here was just to demonstrate the while loop. I kept his original code unchanged (other than running the diagram cleanup tool on it). That said, the VISA driver used to require a VISA Open at the beginning of a program. It was later changed so that the driver would automatically open a VISA reference if it needs one. So, it is not even necessary to have it in there at all - although it is probably still a good practice from a readability point of view. 10-4 thanks Toby. And I knew it wasn't your code snippet. I replied to your post simply because it contained the picture. 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.