Omron CX-Programmer - Read bit status of DINT

purvisl

Member
Join Date
Oct 2015
Location
mississippi
Posts
19
I am modifying an existing Omron CJ-2H CPU66EIP using CX-Programmer version 9.63. I simply need a rung of logic that can determine if a bit is set in DINT[20]. I need to work off the symbol name. The address section can be a working register, CIO or whatever is needed. The SymbolName[2] is being written to by an OPC server. I simply need to chect the status of one bit in the DINT that is written. Please note the Symbol is an array of DINT with a size of 20. I don't think TST will work on a DINT but when I change the symbol to a word, it still will not work. Any ideas out there.

0.0
---[ ]----- TST -----------(MyOutput)
SymbolName[2]
#1
 
Try this BCNT &2 0 D2000 - this does a bit count of 2 channels starting at channel 0.
Then >D2000 &0 out 200.00 - this will turn on output 200.00 if there is ever a bit on in the channels being examined.


I love bit counters and most PLCs do not have a bit count instruction.
 
I would love to simply do this like in RSLogix

Symbol_Name[2].1 to reference the second bit in the array but It seems you can't do that. I have read about unions but do not see that in CX-Programmer on SysWin.

I will try the bit counter solution and get back.
 
Can you please post a screenshot of yr symbol name/config.?
If the data is coming from an OPC server, then it must be using FINS.
I don’t recall any servers that used tag based addressing for the CJ series (but it has been a while)
 
OK, that did not quite work. If any bit is on in the DINT then the output is turned on. I need to detect the status of the 2^1 bit only. I need to ignore the status of the other bits.
 
I don't want to access the bit directly except as a last resort. This is in a hugh program and if someone moves the symbol definition to a new memory location it will break my program. I need to use symbol names if at all possible.
 
I have attached screen shot of the symbol definition.

I am not performing the work on the OPC server. That is another company so I have no idea how the comm is set up. I only have a table of symbol names I have to use in an array.

I am not performing the HMI work either.

Therefore, there is a lot of coordination of names and addresses going on.

Omron Symbol Def.png
 
I am modifying an existing Omron CJ-2H CPU66EIP using CX-Programmer version 9.63. I simply need a rung of logic that can determine if a bit is set in DINT[20]. I need to work off the symbol name. The address section can be a working register, CIO or whatever is needed. The SymbolName[2] is being written to by an OPC server. I simply need to chect the status of one bit in the DINT that is written. Please note the Symbol is an array of DINT with a size of 20. I don't think TST will work on a DINT but when I change the symbol to a word, it still will not work. Any ideas out there.

0.0
---[ ]----- TST -----------(MyOutput)
SymbolName[2]
#1

Did you try the TST?

TestBit.PNG
 

Similar Topics

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
388
I am using a function block that has a in/out parameter that is a structure. The structure has an array as one of the elements. I can index the...
Replies
1
Views
748
Is there a way in CX-Programmer to call Ladder Instructions from a structured text program? I can see several functions in the autocomplete...
Replies
3
Views
1,991
Is there a way in CX-Programmer to call functions from a structured text program? I have found this manual that seems to describe the process...
Replies
1
Views
1,070
Is there a way in CX-Programmer to initialise an array? Set all values to zero or false depending on the data type Solutions in Ladder and...
Replies
2
Views
1,304
Back
Top Bottom