gardarog
Member
I'm having trouble byte swapping data in RSLogix 5000.
I'm reading data from a couple of power analyzers and controllers for refrigeration compressors via a Profibus network.
The controllers for the refrigeration compressors are called UNISAB, manufactured by Sabroe (I think now Johnson Controls Inc.) and the power analyzers are of make Janitza UMG 508.
The network consists of:
1. A ProSoft MVI56-PDPMV1 DP-V1 master
2. Thirteen UNISAB controllers
3. Three Janitza power analyzers
The UNISAB controllers use high/low byte swapping for their profibus inputs, so I've configured the DP-V1 master to accumulate for that.
However the power analyzers don't use swapped inputs so I somehow need to swap their 62 input words.
I've tried using a COP operand to copy the relevant input data for the power analyzers to a SINT[124] array (62words x 2bytes/word=124bytes) and used that SINT[124] array as an input parameter for the SWPB operand. However it seems the SWPB of RSLogix 5000 doesn't handle arrays as well as the SWP operand of Logix 500, and returns an 'invalid data type' error.
Does any of the PLC guru's here perhaps have a quick workaround for this issue, as it would be a very tedious and tiresome task to do this manually for each and every one of the inputs...
TL;DR
How would one go about swapping a SINT[124] array in RSLogix 5000 without succumbing to suicidal tendencies?
I'm reading data from a couple of power analyzers and controllers for refrigeration compressors via a Profibus network.
The controllers for the refrigeration compressors are called UNISAB, manufactured by Sabroe (I think now Johnson Controls Inc.) and the power analyzers are of make Janitza UMG 508.
The network consists of:
1. A ProSoft MVI56-PDPMV1 DP-V1 master
2. Thirteen UNISAB controllers
3. Three Janitza power analyzers
The UNISAB controllers use high/low byte swapping for their profibus inputs, so I've configured the DP-V1 master to accumulate for that.
However the power analyzers don't use swapped inputs so I somehow need to swap their 62 input words.
I've tried using a COP operand to copy the relevant input data for the power analyzers to a SINT[124] array (62words x 2bytes/word=124bytes) and used that SINT[124] array as an input parameter for the SWPB operand. However it seems the SWPB of RSLogix 5000 doesn't handle arrays as well as the SWP operand of Logix 500, and returns an 'invalid data type' error.
Does any of the PLC guru's here perhaps have a quick workaround for this issue, as it would be a very tedious and tiresome task to do this manually for each and every one of the inputs...
TL;DR
How would one go about swapping a SINT[124] array in RSLogix 5000 without succumbing to suicidal tendencies?