Red Lion Crimson 3.1 writing array position into tag

Join Date
Jan 2014
Location
VA
Posts
27
I'm working with Crimson 3.1. Is there a way to write an array's position into a tag?

For example, I have an array size of 100, I'll call them "array[0]-array[100]". These are integer tags that will contain random numbers.

When I'm referencing data in position [0], I'd like to write "0" into another tag.

When I'm referencing data in position [99], I'd like to write "99" into another tag.

How could I achieve this?
 
You have almost answered you own question. Create an Integer Tag, if you are controlling it from the HMI it can be an internal tag, I will call it arrayPos. To read array[0] I would set arrayPos to 0 and then use array[arrayPos].

Code:
int result;  [COLOR=green]// You set the type to match the contents of the array[/COLOR]

arrayPos = 0; [COLOR=green] // arrayPos is a tag and can be accessed from anywhere[/COLOR]

result = array[arrayPos];  [COLOR=Green]// You already set up the array elsewhere[/COLOR]
arrayPos could be local to the program instead of a global tag, but then you would have to declare it within the program and you can only use it within the program.
 
BryanG : "Knowledge is power, share the knowledge."


You mean give away my powers ? Not a chance, lol
 
Thank you, thank you very much folks, we are here all week.

Knowledge is power, but a good joke has more kilowatts.

When I read that back it makes no sense, must be an electrical engineer thing.
 

Similar Topics

How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
101
Hi, I am trying to increase the size of the user login pop up using a Red Lion CR1000 7” HMI with Crimson 3.1 software. The login pop up is very...
Replies
2
Views
664
Hello, We are currently running a bunch of g310's connected to their SLC5 PLCs through ethernet. I've attempted to upgrade the program from 2.0...
Replies
1
Views
1,107
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do. It would be nice if whenever a...
Replies
4
Views
1,009
Well, I have yet another question for the great minds on this forum! We have a red lion HMI for one of our machines and every time I hook my...
Replies
11
Views
1,657
Back
Top Bottom