LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Push-button wont activate

Solved!
Go to solution

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 ?

 

Download All
0 Kudos
Message 1 of 14
(3,223 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 14
(3,212 Views)

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 🙂

0 Kudos
Message 3 of 14
(3,202 Views)

Hi Nightstaber,

 

you may use this...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 14
(3,198 Views)

Thanks a lot.. That did the trick 🙂

 

Edit: Apparently not

0 Kudos
Message 5 of 14
(3,194 Views)

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

0 Kudos
Message 6 of 14
(3,187 Views)

Hi Nightstaber,

 

you asked for "delay my boolean by one second, then send it out"...

 

What about putting a Wait function in your while loop? Wating for 1s?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(3,181 Views)

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 🙂

0 Kudos
Message 8 of 14
(3,178 Views)

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:

State Machines

Tutorial: State Machines

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 9 of 14
(3,145 Views)
Solution
Accepted by topic author Nightstaber

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..

0 Kudos
Message 10 of 14
(3,136 Views)