Hello all. I am new to Crimson 3 and code in various other fields so looking for some ideas.
First off what I am doing (maybe someone has a better idea)
We have an oven with 180 shelves that travel around. Its gets loaded automaticaly and unloaded. It shifts every 20 seconds. So I have drawn a conveyor on the screen, added 180 LEDs along the conveyor to represent each shelf. I have created an array tag of 180 of type signed integer. each shelf can have a value of say 0-empty 1-product 1 or 2 for product 2
So all the array is of valu 0. The leds are hidded if its a zero
First question. In the show section of the indicator, how do I code the complex part so if the value of the corresponding array bits is anything other than zero it will show and if its zero it will not
if( Group1.shelf_array[0]) <> 0 then show else
So basicaly product 1 starts being loaded. Group1.shelf_array[0]) will now equal 1. When the conveyor moves I need Group1.shelf_array[1]) to equal 1 and Group1.shelf_array[0]) = zero
Can I manipulate arrays with a loop or while statement (I program in Delphi/PAscal)
Like
Cnt := 0
While cnt > 180 do
Begin
Group1.shelf_array[180 - cnt]) := Group1.shelf_array[180 - (cnt+ 1)])
Or do I have to write 180 lines of code
End
First off what I am doing (maybe someone has a better idea)
We have an oven with 180 shelves that travel around. Its gets loaded automaticaly and unloaded. It shifts every 20 seconds. So I have drawn a conveyor on the screen, added 180 LEDs along the conveyor to represent each shelf. I have created an array tag of 180 of type signed integer. each shelf can have a value of say 0-empty 1-product 1 or 2 for product 2
So all the array is of valu 0. The leds are hidded if its a zero
First question. In the show section of the indicator, how do I code the complex part so if the value of the corresponding array bits is anything other than zero it will show and if its zero it will not
if( Group1.shelf_array[0]) <> 0 then show else
So basicaly product 1 starts being loaded. Group1.shelf_array[0]) will now equal 1. When the conveyor moves I need Group1.shelf_array[1]) to equal 1 and Group1.shelf_array[0]) = zero
Can I manipulate arrays with a loop or while statement (I program in Delphi/PAscal)
Like
Cnt := 0
While cnt > 180 do
Begin
Group1.shelf_array[180 - cnt]) := Group1.shelf_array[180 - (cnt+ 1)])
Or do I have to write 180 lines of code
End