issue reading Process Image byte variables

Topics about the Software of Revolution Pi
Post Reply
User avatar
livesource
Posts: 7
Joined: 11 Jun 2021, 00:17
Answers: 0

issue reading Process Image byte variables

Post by livesource »

Hi,

I am having an issue reading any of the Process Image byte variables ... ie. DIn_Status, DOut_Status, RevPiLED all return 00000000 regardless of the actual state.

Example

Code: Select all

piTest -w DOutBit_1,1 
Success - Activates OUT 0 LED on the unit

Code: Select all

piTest -1 -q -r DOutBit_1
Success - Returns "1"

Code: Select all

piTest -1 -q -r DOut_Status,b
Fail - Returns "00000000"
I Expected - "10000000" from this. Have I got something wrong here? How can I read all the DOut_x bits in one piTest command?

I posted about this last week here viewtopic.php?f=6&t=2884#p10472, but still haven't got a response. I'm really hoping someone can help me here as I've got quite a tight deadline to get this project working. I've also just plugged in a ModBus slave and am having a similar issue with that... I can read BOOL variables ie Input_Bit_1 = 1 but not WORD variables ie Input_Word_1 = 00000000 00000000.


Thanks for any suggestions!
User avatar
livesource
Posts: 7
Joined: 11 Jun 2021, 00:17
Answers: 0

Re: issue reading Process Image byte variables

Post by livesource »

Additional issue: Modbus_Actions_Status errors not resetting

The example below is for an action configured as follows

Action #2 | 95 | READ_HOLDING_REGISTERS | 40004 |1 | 1000 | Input_Word_7


1.

Code: Select all

piTest -q -r Modbus_Action_Status_2
This returns "2"
I understand 2 = ILLEGAL DATA ADDRESS

2.
I now want to reset the error code on Modbus_Action_Status_2 so that I can try a different address and check if the error is reported again.
I remove Action 2 from the Extended Data GUI so that the error is not regenerated while poling, then...

Code: Select all

piTest -w Action_Status_Reset_2,1
This returns "Set bit 1 on byte at offset 207. Value 1"

3.

Code: Select all

piTest -q -r Modbus_Action_Status_2
This still returns "2"
I expected this would be 0

Modbus_Master_Status is 0 the whole time. The variable Input_Word_7 is also 0 the whole time. I am able to read the addresses 40004 the slave fine using a gui on my PC and it returns 5. I was also able to read 40004 using minimalmodbus on the revPi, but I had to use "Raw Address" "3" rather than 40004. I'm not sure if this Raw Addressing is common or something particular to the monnit gateway I am working with.
User avatar
nicolaiB
KUNBUS
Posts: 877
Joined: 21 Jun 2018, 10:33
Answers: 8
Location: Berlin
Contact:

Re: issue reading Process Image byte variables

Post by nicolaiB »

Hi
livesource wrote: 28 Jun 2021, 05:39

Code: Select all

piTest -1 -q -r DOut_Status,b
Fail - Returns "00000000"
I Expected - "10000000" from this. Have I got something wrong here? How can I read all the DOut_x bits in one piTest command?
Why do you expect a different value than 0? Extract from the wiki:

Code: Select all

DOut_Status: if this byte has a value not equal to zero, the digital outputs were cutout due to emergency. Bit 5 indicates overheating (150 °C). As soon as the error state is over, DOut_Status goes back to zero. D
User avatar
nicolaiB
KUNBUS
Posts: 877
Joined: 21 Jun 2018, 10:33
Answers: 8
Location: Berlin
Contact:

Re: issue reading Process Image byte variables

Post by nicolaiB »

Hi,

please remove any register configuration and restart the modbus driver / reset the action. Is it still != 0?

Regarding the raw address: I have a Modbus RTU meter connected to my RevPi and having the same issue that the register address is specified with 30007, but I have to use 7 in order to get data. Ihmo this comes from the original Modbus specs which where written with Modicon controllers in mind where the function code was encoded in the address.

Nicolai
saardrimer
Posts: 18
Joined: 15 Jun 2021, 14:16
Answers: 0

Re: issue reading Process Image byte variables

Post by saardrimer »

I think that some of the issues I've been experiencing are related:

viewtopic.php?f=6&t=2905

Could there be something about Modbus registers with 5 digits being mishandled somehow?

It would be great to know what is causing this issue and if it's a piTest issue or something else.
Post Reply