Array manipulation with crimson 3

secs

Member
Join Date
Aug 2015
Location
Office
Posts
65
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
 
Are you just looking for proper syntax of Redlion while loop?
try this:

cnt := 180;
while ( cnt > 0)
{
Group1.shelf_array[cnt]) := Group1.shelf_array[cnt - 1]);
cnt--;
}
Group1.shelf_array[0] := 0;
 
sorry, left a couple extra parenthesis from copy-paste

cnt := 180;
while ( cnt > 0)
{
Group1.shelf_array[cnt] := Group1.shelf_array[cnt - 1];
cnt--;
}
Group1.shelf_array[0] := 0;


For the show property, if you want everything not zero to show, just put in the array and index you want
Group1.shelf_array[index]
anything other than zero will be made visible
 
The programming reference is hidden near the bottom of the general Crimson 3 manual (not the reference manual).
 
I also needed help with hiding the corresponding indicator if the shelf/array bit is empty/0

I gather in the SHOW property I can write a bit of code but I need help with the syntax.

So I click on the indicator and select the SHOW part

In the general I hit edit and added the tag with a > symbol

Group1.shelf_array[0] > 0

and it accepted it so I hoping thats it.
 

Similar Topics

Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
4
Views
191
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
203
I have an array of 55 REAL values. Is there a way to multiply based on the array location ? I have 55 transfer belts that are equally spaced...
Replies
3
Views
153
Hello everyone, I'm working on a project that involves controlling an array of nozzles within a CNC environment, where the nozzles travel along a...
Replies
5
Views
176
Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
428
Back
Top Bottom