CX-Programmer: concatenate hex value

khelza

Member
Join Date
Sep 2015
Location
Ontario
Posts
67
I have an existing program for a machine which can run 50+ different parts. Each part has 10 parameters allocated and I have to modify the program to include a few more parameters. Each part is also assigned a hex value starting at 500 and increasing by 10 for each part (510, 520, 530, etc.)

There is a XFER function which looks at the value of the current part number and copies the 10 elements (parameters) from the D location of that part number to a different memory location, D10 to be used in the logic.
For example, if part with the assigned hex value of 550 was selected, the 10 words in memory location D550 would be copied to D10. It would have been nice to just increase the amount of words copied over, however, those words are used by other parts (560 in this example).

I need to store the new parameters somewhere else, and wanted to do it in a similar way with the XFER function.

I'm trying to take the hex value, still using example part 550, and concatenate or append a 0 to the end, so that another XFER function would copy from location D5500 into memory location D20 for example.

I have not been able to concatenate properly and I'm not sure if this is the best way to go about it because the memory locations would be so spread out: D5500, D5600, D5700 providing/allowing 100 words, when I only need about a few. :oops:

Apparently there's a way to offset with the XFER function?
XFER
Number of words: 4
Source: value of D105 + 5000?
Dest: D10

Anyone know how to do that?
 
Last edited:
You did not indicate which plc you are using.

Just a thought, can you multiply the current storage location by 10 to get the new storage location?

Source and Destination words can be D locations and should be able to be indirectly addressed.

Hope this helps.
 

Similar Topics

bonjour je souhaiterais savoir si c'est possible de faire communiquer Cx-programmer ( logiciel de programmation des automates Omron ) avec...
Replies
2
Views
166
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
167
I need a good website or tutorial to learn plc programming Thank you
Replies
10
Views
519
Hello ! I am trying to use an omron cj2m-cpu33 with a CP1W-CIF01 plug in serial connector to talk to a zebra ZT610 printer. I am getting the data...
Replies
8
Views
394
Dear all, First of all thanks for letting me join this forum. I just need some help in one of my programming exercises. Being a beginner...
Replies
6
Views
623
Back
Top Bottom