I am using Omron CJ1M model. It's quite old model and i am using first time Omron.
Ok, first the methodology, to programme all in Ladder which also i am not much familiar.
So, i had done my programe in STL and then this STL Programme i convert it in Function block.
This function block i had called in Main programme in ladder. My programme is for drive.
Now, i got problem with assignment of bool in STL and it is showing me error which is Undefined identifier although i assign by input and output corresponding.
Ok ,one examle of it. I mentioned here.
(** SCON Byte_1**)
DrivenEnabled := I_D1.0; (**SCON Byte Assignment**)
Ready := I_D1.1;
Warning := I_D1.2;
Fault := I_D1.3;
Supplyvoltage := I_D1.4;
ControlFCT_HMI := I_D1.5;
StateOperationMode0_1 := I_D1.6; (* Selection of mode*)
StateOperationMode0_2 := I_D1.7; (*Selection of mode*)
here, variable I_D1 is DINT and all other variable like DrivenEnabled,Fault,Warning etc are bool.
I dont understand , if i assign I_D1 as DINT and all other variables are bool then, why it is showing error as Undefined identifier? I got error with all bits of I_D1.0 to I_D1.7 and even with all variables.
Bcoz for allenbradely or siemens plc's etc are working correctly.
Pls help me.
You cannot address to bit level of integers in CX-P, yet anyway. There are other ways to achieve what your wanting to do. Omron is not allen bradley, like allen bradley is not siemens, like siemens is not AD, like AD is not mitsubishi, like mitsubishi is not fanuc, like fanuc is not toshiba, I could go on, but are running out of PLC manufacturers!!
To access the individual bits in this manner, you should make I_D1 an array (32 bits), then address the individual bits as eg. I_D1 (for bit 2).
If I_D1 MUST be a DINT, then I would suggest using (if possible) an AT address for I_D1 (DINT) and use the same address for your BOOL array (obviously with a different name).
Alternatively, there are the TST instructions, which can extrapolate the bit value within a given word.
Your work-around -
Create a variable...
Name = MyDint
Data Type = DINT
AT Address = W300 (or any valid available address) - bear in mind that being a DINT, this will occupy words W300 and W301.
Create a second variable...
Name = MyBoolArrayOfDint
Data Type = BOOL
Array Size = 32
AT Address = W300 (or the same address as was used for "MyDint".
Now, MyBoolArrayOfDint -  will equate with bits 0 - 31 of MyDint.
Therefore, if MyDint has a value (say) of 1, then MyBoolArrayOfDint will = TRUE.
Remember, you cannot used 'Structure' type programming in CX-P yet, so anything that ends in ".n" will be rejected (unless you are using SFC, in which case there is a degree of Structure allowed, but that is something different altogether.