Welcome, Guest
Username: Password: Remember me

TOPIC: TCP Remote connection

Re:TCP Remote connection 13 years 9 months ago #861

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3177
  • Thank you received: 502
  • Karma: 133
Hmm... Looks ok to me.

Try this
[code:1]OI++;[/code:1]
It should be the same thing.

The c++ comment '//' is not 100 % safe in DataArithm code, use /*... */ instead.

/Claes
The administrator has disabled public write access.

Re:TCP Remote connection 13 years 8 months ago #896

  • Bjorn
  • Bjorn's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 18
  • Karma: 0
Hi again!

Rewrote most of the code and now I got a very weird problem.

All my bool values will not become false. I Have most of them on false from the start and that works fine. When I update them they become true and that is also fine. The problem occurs when I try to set them to false. It doesn't work, it won't store 0 (od1 = 0) in the Dv value. Tried many solutions and switched command numbers for the set if's.

This is for all my digital outputs, none of them will be set to 0 again.

full code:
[code:1]
/* Reset */
if(I1 == 99 && d1 == 1){
od1 = 0; /*Polish off*/
od2 = 0; /*Running off*/
OI1 = 0; /*Buffer*/
OI2 = 1; /*Buffer Size*/
OI3 = 0; /*Produced*/
}
else{
int v = I1 - 600;
/* Polish ON */
if(v == 1 && d1 == 1){
od1 = 1;
}
else if(v == 2 && d1 == 1){
od1 = 0;
}
else{
od1 = d2;
}
/* Running */
if(v == 3 && d1 == 1){
od2 = 1;
}
else if(v == 4 && d1 == 1){
od2 = 0;
}
else{
od2 = d3;
}
/* Buffer Inc */
if(v == 5 && d1 == 1){
OI1 = I2 + 1;
}
else if(v == 6 && d1 == 1){
OI1 = I2 - 1;
}
else{
OI1 = I2;
}
/* Buffer Size Inc */
if(v == 7 && d1 == 1){
OI2 = I3 + 1;
}
else if(v == 8 && d1 == 1){
OI2 = I3 - 1;
}
else{
OI2 = I3;
}
/* Produced */
if(v == 9 && d1 == 1){
OI3 = I4 + 1;
}
else{
OI3 = I4;
}
}[/code:1]

also tried:
[code:1]
else{
int v = I1 - 600;
/* Polish ON */
if(v == 1 && d1 == 1){
od1 = 1;
}
if(v == 2 && d1 == 1){
od1 = 0;
}
//---
else{
int v = I1 - 600;
/* Polish ON */
if(v == 1 && d1 == 1){
od1 = 0;
}
if(v == 2 && d1 == 1){
od1 = 1;
}
[/code:1]
The administrator has disabled public write access.

Re:TCP Remote connection 13 years 8 months ago #897

  • Bjorn
  • Bjorn's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 18
  • Karma: 0
After looking through the code a saw that I have used setDv instead of stoDv, very confusing names ;)

No it works
The administrator has disabled public write access.
Time to create page: 8.149 seconds