04-23-2013 03:41 AM - edited 04-23-2013 03:56 AM
Hi all..
As a beginner with Labview i have been very happy to have these forums to help me out with a lot of issues, from other posts.
Although this time i haven't been able to find an answer, so here goes.
I am making a VI that will allow me to send SMS messages from my computer. My computer is connected to a GSM modem, and there is a subVI that controls the serial connection.
The problem i am having now is that my button to send the commands (the one that activates my case structure) wont activate. I have tried to add an LED to see if that would show anything, but it made no difference. The LED isn't turning on.
Basically what i do is that i have a textfield for the recipient number which adds "at+cmgs=+45" in front of it and the ascii value of hex 0D after it. Then a textfield for the message, where i add the ascii value of hex 1A afterwards to send.
This setup works in smaller steps, like Sms_Send3, but it is in Sms_send5 i am having issues with it.
Any ideas? 🙂
Edit: Minor typo
Edit: If i add an indicator to the largest while loop, it seems like that while loop isn't running at all ?
Solved! Go to Solution.
04-23-2013 04:00 AM
Hi Nightstaber,
it's a problem of the DATAFLOW! You didn't obey it...
Watch your SMS5 vi in highlighting mode and you will notice your problem: the inner while loop will never stop and so (due to DATAFLOW) your case structure is never called...
04-23-2013 04:50 AM
Ah.. I see..
So basically what happens is that the small while-loop isn't sending data through to the Or gate, and as of that nothing else will happen?
How can i make it work? All i really want it to do is to delay my boolean by one second, then send it out.. Is there any other way i can do that?
🙂
Thanks a lot so far 🙂
04-23-2013 04:54 AM
04-23-2013 05:08 AM - edited 04-23-2013 05:33 AM
Thanks a lot.. That did the trick 🙂
Edit: Apparently not
04-23-2013 05:33 AM
Actually, that didn't do the trick.. That one will keep looping, and i need only a single run..
I need to pause the signal for 1 second, then send it out again.. The one you linked will keep counting, and keep sending the value out after x amount of cycles
04-23-2013 05:45 AM
04-23-2013 05:55 AM
The problem is that doing it that way, will delay both my booleans...
What i need is that when i press the switch, it should send the first boolean right away, since that will trigger the AT command for sending the recipient number.. Then i need it to delay the same signal for 1 second, so that 1 second later it will activate and send the AT command for the text i want in the sms 🙂
I have done it with an Elapsed Time in another design, but using an Elapsed Time gives me some odd results as it will run when i run the VI the first time as well.
I was trying to use a case structure with a wait inside, but it seems like it will delay the entire while loop rather than just the one i need delayed.
I appreciate your help though 🙂
04-24-2013 07:00 AM
Hi Nightstaber.
I have made a quick example of what I think you are trying to achieve. I have used a State-machine architecture with an event structure.
In the event structure I monitor the 'Send' and 'Stop' button. When send is being pressed I go to the Send state, which sends the first part of the message. Then, I go to a wait state which waits for 1 second before proceeding to the Send state again.
Some points to consider:
* The Wait state could be improved: As of right now, the VI does not perform anything in the wait state. One could make a timer to call several times. If time is passed, then go to send, if not, then go to X state and do something else.
* The enum should be typedef.
I have NOT tested this example, since I do not have 'MercantecSMS'. However, I hope you'll find this example useful and is able to combine it with what else you want to achieve.
For more information about how to use a State-machine:
04-24-2013 07:51 AM
I figured out that i could do what i wanted to do with a sequence..
It's kinda embarassing to have found out that it was something so simple.
Thanks a lot for your help though guys.. Appreciate it 🙂
Regards..