How does one increment and save an element variable, (x), under the NXP Rapid IOT menu?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How does one increment and save an element variable, (x), under the NXP Rapid IOT menu?

1,011 Views
johnsorensen
Contributor II

I tried a simple counter under the NXP Rapid IoT. I would have thought this should very simple to do. But one can't reuse an existing element variable, call it c1, to write  a new value into it. Writing the incremented variable with the math operator element forces one to store the incremented value into another variable, call it c2.  C2 can be routed back and store into variable c1, but then there is some racing occurring for about a second, then it counts properly. It would be good to be able to increment c1 in the NXP Rapid IoT tab in an easy method that works. At the moment I am not using the Hexiwear Docking Station, just a USB connection to the Rapid IoT Platform. Or is there a work around for this? Or what am I missing?

0 Kudos
3 Replies

840 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

Are you using the Rapid IoT Studio or the MCUXpresos IDE? I believe that you are using the studio with the information you provided, nonetheless, could you please help me confirm? 

Also, I'm not sure I fully get what you are trying to do, but I believe that you might find helpful one of the following three examples that work with variables management. Could you please check those? I believe those can help you as a base. 

pastedImage_3.png 

Regards, 
Estephania 

0 Kudos

840 Views
johnsorensen
Contributor II

I previously had looked at the examples you referenced, but they did not answer my question. I am simply trying to read the number of times a pulse is input and storing that value in the IoT device or simulating the same by increment a count variable. Either way, I want to store the value back to the incremented variable. That is count = count + 1;

0 Kudos

840 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

How are you implementing it? 

Could you please show me the diagram of the elements used? 

Regards

0 Kudos