Access Modbus register not mapped to an eWON register

I’ve got a couple issues where I am trying to read/write individual bits of a Modbus register (402810) for a control word that a VFD uses. I believe that this register is not mapped to an eWON register and as a result the returned value is 0.

While I can successfully write a value to the control word, I am unable to write to a specific bit, and there are other drawbacks as well. It is important that I only control specific bits because many of the bits I do not want to affect may need to change due to internal controls on the drive. The two bits I do want to affect are bit 6 and 7 (enable and fault reset in this case).

The main drawback to writing the full value to the control word itself is that it forces the value. The drive no longer can affect the control word meaning the intended enable would become a forced run or stop command. This is also problematic since the drive would no longer be able to take any action in the event of a fault which could damage the drive or other equipment downstream.

The way that I have been trying to write to the bits is by the following lines in the cyclic section of the BASIC IDE:

Pump1_CW@#6 = Pump1_CW_EN@
Pump1_CW@#7 = Pump1_CW_RST@

Pump1_CW is set up as an integer and the Pump1_CW_EN and Pump1_CW_RST are set up as Boolean values.

Changing the two Boolean values in this case also has an unexpected result. Instead of changing bits 6 and 7 and getting an output of either 64, 128, or 192, Pump1_CW simply takes the value of the latter tag making it either a 0 or 1.

I have already planned for another resolution for the controls, but am nonetheless curious about whether or not this is even possible.

Hello,

If you could please supply a back up of the device with support files, so that I may review the settings and any BASIC code you are running?

Also, the boolean values are on programmed to return a 0 or 1. Are you trying to get a int value?

Mitchell Lewis & Staver.zip (190.0 KB)

The Pump1_CW_EN and Pump1_CW_RST are boolean, but Pump1_CW is an int. I would expect that if bit 6 is set to 1 on an int where everything else is 0 I’d get 64.

All of the commented sections are experimental and/or broken.

a% = INT(Pump1_Status@)
Pump1_Status_1@ = a%#3
Pump1_Status_10@ = a%#11

b% = INT(Pump2_Status@)
Pump2_Status_1@ = b%#3
Pump2_Status_10@ = b%#11

//c% = INT(Pump1_CW@)
//c%#6 = Pump1_CW_EN@
//c%#7 = Pump1_CW_RST@

//Pump1_CW@#7 = Pump1_CW_RST@
//Pump1_CW@#6 = Pump1_CW_EN@

//d% = INT(Pump2_CW@)
//d%#6 = Pump2_CW_EN@
//d%#7 = Pump2_CW_RST@

//IF (Pump1_CW_EN@ = 1) THEN
// Pump1_CW@ = 1148
//ELSE
// Pump1_CW@ = 1048
//ENDIF

Topic closed due to inactivity.