Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Resetting the variable.

Resetting the variable. 5 years 4 weeks ago #10237

  • Gierula
  • Gierula's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 46
  • Karma: 0
Please help.
How to reset the variable, below is an example. It does not work because the variable is permanently connected to the setting output.
I do not have an idea anymore.
zmienna.png
The administrator has disabled public write access.

Resetting the variable. 5 years 4 weeks ago #10238

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3177
  • Thank you received: 502
  • Karma: 133
Hi Gierula,

StoDv will write the value from the input pin every scan. SetDv will only write when the input is high, but will not reset when the input goes low, so you might also need a ResDv. With edge objects you will only write on edges and can then write from other places in between.

There also seems to be some parenthesis missing in the CArithem code, it should be
if (A1 == 10) {
  od1=1;
  OA1= 0;
}
else
  od1=0;

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: Gierula

Resetting the variable. 5 years 4 weeks ago #10239

  • Gierula
  • Gierula's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 46
  • Karma: 0
I wrote vaguely.
I want to reset the AV variable.

I need a SetAv function.

I'm sorry, I wrote the code sloppily.
{} :)
Last Edit: 5 years 4 weeks ago by Gierula.
The administrator has disabled public write access.

Resetting the variable. 5 years 4 weeks ago #10241

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3177
  • Thank you received: 502
  • Karma: 133
Then you can use the CStoAv that will only write when the condition input is high.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: Gierula

Resetting the variable. 5 years 4 weeks ago #10242

  • Gierula
  • Gierula's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 46
  • Karma: 0
Thank you.
I missed that.
variable.png
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.854 seconds