UnityPRO FORCED VALUE list

sg0502

Member
Join Date
Jun 2019
Location
BOGOTA
Posts
3
is it possible to external read the Forced_value list from a PLC using UnityPRO?
I need to get this data.
It could be via modbus, ops... or even export it to .csv
Thanks for any help
 
There is block "is_bit_forced". So you can make loop, check every bit on %M or %I-level and save comparing result to array of ebools.
As it long loop, it would be advisible divide looping to several different PLC cycles so that loop would not increase PLC cycle.


But do you really need that, when Unity online view shows Forced varriables as list at online view.
Where you need that list outside from PLC?
 
Thanks!!! Excellent idea

We need outside UnityPro because we are uploading this list to the cloud for monitoring.
 
There is block "is_bit_forced". So you can make loop, check every bit on %M or %I-level and save comparing result to array of ebools.
As it long loop, it would be advisible divide looping to several different PLC cycles so that loop would not increase PLC cycle.


But do you really need that, when Unity online view shows Forced varriables as list at online view.
Where you need that list outside from PLC?
Ok, so this means that via scripting it is possible to do it automatic?
I have used the "is_bit_forced" but I had to map every signal to an array. That means to manually assemble it... for testing is fine but not for a large database.
 
On variable editor make array variable for original %M addressing


M_array, array [0..99] of ebool, start address %M0


And another array


M_forced_array, array [0..99] of ebool, start address %M4000



Then on ST-code section


Code:
(*Check if address %M0..%M99 is forced *)

(* if forced bit is finded, set bit true on forced array table *)
(* (array location = %M address index *)



for i:=0 to 99 do;


force_test_bit1 := IS_BIT_FORCED (IN :=(M_array[i]) );


if force_test_bit1= true then
M_forced_array[i]:=true;
else
M_forced_array[i]:=false;
End_IF;

End_For;
On PLC settings you need to enable array addressing and uncheck memory overlapping, so build not generete warnings of same address used twice on variables (your original symbols and array_variables for looping are using same addresses)


%M4000..4099 is showing to modbus if there is forced variables on %M0..%M100


For IO you can do same, but you need divide input / output arrays to same lenght, than you have DI / DO inputs / output cards.


For topological DI start addressing is (DI module on rack0, slot 2 => %I0.2.0 for array start and lenght 16, 32 or 64 depending of cards)
 
Last edited:

Similar Topics

Hi, I'm wanting to write a rung that clears a whole output card (64 bits 4 words). I can do it in structured text for each individual bit but...
Replies
0
Views
1,311
Hi All, I'm new in UnityPro. Can you all guys help me on the UnityPro Programming? I need to create a Sequential Table (Recipe type format)...
Replies
7
Views
1,826
Can someone please help me to overcome the version issue of unitypro software. I was trying to transfer the program in to PLC and it throws this...
Replies
13
Views
3,672
Hi Everyone, Is there an RTO (Retentive Timer) function in UnityPro, or do I need to create the block on my own? Any tips would be appreciated...
Replies
1
Views
1,648
Hi Guys, Have a simple question. New with UnityPRo V6.0 and Vijeo Designer. Need to slow the update time to analog channels on the HMI so the...
Replies
1
Views
1,605
Back
Top Bottom