Crimson V3/Red Lion Complex Code

renu

Member
Join Date
Jul 2012
Location
casper
Posts
13
Hello,

I'm trying to use a complex code with the DevCtrl System action with no success. I need to actually use a button or data tag that can be altered on screen to change the Primary Target IP at any time, " located in Network, protocol 1 - Modbus TCP/IP Master, SP32 or what ever you named it" Under device Identification you have your Primary IP Address. I was told its possible to change it but Im having no luck.

Only reason I need this function is because I have it where I can change the slave PLC IP address on screen and I need to be able to change the IP the Redlion is looking for to pull data from witch is the Primary IP address.

Any help is greatly appreciated, and I included a picture of exactly what needs to be changed.

Thanks

Mike

Help.jpg
 
Hello,

I'm trying to use a complex code with the DevCtrl System action with no success. I need to actually use a button or data tag that can be altered on screen to change the Primary Target IP at any time, " located in Network, protocol 1 - Modbus TCP/IP Master, SP32 or what ever you named it" Under device Identification you have your Primary IP Address. I was told its possible to change it but Im having no luck.

Only reason I need this function is because I have it where I can change the slave PLC IP address on screen and I need to be able to change the IP the Redlion is looking for to pull data from witch is the Primary IP address.

Any help is greatly appreciated, and I included a picture of exactly what needs to be changed.

Thanks

Mike

Use the DevCtrl() function. It has been a while since I have done this but you may have to either restart the display or disable the Device and Reenable it to get it to work.

I would create different String Tags with the required IP Addresses. Make them General Tags with the Sources as shown (for instance)
Device1_IP - in the Source field put "192.168.1.121"
Device2_IP - in the Source field put "192.168.1.122"
etc.

Create 2 Buttons and make the code as follows:
Button1 - DevCtrl(SP32,1,Device1_IP)
Button2 - DevCtrl(SP32,1,Device2_IP)

As I said, you may need to include another line of programming that either stops and starts the Communications Device or you may need to stop and restart the display.

Play with it and figure out which.
 
@JHarbin

Thanks for that example, the code example helped alot, I was using the DevCtrl function but entering it the wrong way, now it works the correct way. Thanks!
 
Hey, but one last question, Is it possible to change the IP address in the Network tab of the HMI as well? I don't think I't can be done like we did the above. Thanks again
 
Hey, but one last question, Is it possible to change the IP address in the Network tab of the HMI as well? I don't think I't can be done like we did the above. Thanks again

There may be other ways...

Create an integer tag and format it like IP Address. Call it (for example) G315_IP_ADDRESS

Make the Port Settings IP Address on Communications Tab to =G315_IP_ADDRESS (you must use the =)

Assuming you will have the same Mask and Gateway for both networks set them manually, if not you can set them through code the same way. you will create additional integer tags for mask and gateway.

Create some String Tags

G315_IP1 and set it to "192.168.1.110"
G315_IP2 and set it to "192.168.1.111"

Create two buttons and run this on the first

G315_IP_ADDRESS := TextToAddr(G315_IP1);
// the next two lines are examples of how to set the mask
//and gateway
//G315_MASK := TextToAddr(G315_MASK);
//G315_GATEWAY := TextToAddr(G315_GATEWAY);
CommitAndReset();

Under the second use

G315_IP_ADDRESS := TextToAddr(G315_IP2);
// the next two lines are examples of how to set the mask
//and gateway
//G315_MASK := TextToAddr(G315_MASK);
//G315_GATEWAY := TextToAddr(G315_GATEWAY);
CommitAndReset();

The display will reset with the CommitAndReset, but this is required.
 

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
107
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
668
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,121
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,015
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,670
Back
Top Bottom