AdvancedHMI Software
General Category => Support Questions => Topic started by: automatizzando on November 06, 2016, 09:59:08 AM
-
Hello Guys, it's the first time I use advanceHMI.
Sorry for my bad english.
How can a writing pad the value of a single bit.
I can read the individual bits in the address by entering properties.
for example 414200.1
But if you want to write me error.
I tried both and
614200.1
6:14200.1
6:14200,1
In both cases me error.
Vorri write it with the subject "Pilotlight"
I hope you understand what I wrote.
Thank you
-
In order for this to work your device must support Modbus function 22 (0x16) which is masked bit write. Otherwise it is only possible to write to normal bit addresses
-
Thanks for the answer, but if my device supports the function 22 (0x16)
How do you spell the correct size?
With the evidence I have done, I give me back the incorrect format error.
Thank you
-
The addressing is like this:
40001.0
40001.1
If I remember correctly, you will also need the 3.99r driver patch 3 for function 22 to work correctly:
http://advancedhmi.com/forum/index.php?topic=1470.msg7900#msg7900
I do recommend testing with ModRSim because that software is known to implement function code 22.
-
I recommend ModRSsim2 (Archie left out the second s) and the 2 on the end is a later version.
It supports Modbus Function Code 22 (Hex 16) for both Serial and Ethernet protocols.
It is available here: https://sourceforge.net/projects/modrssim2/ (https://sourceforge.net/projects/modrssim2/)
The original version of Mod_RSsim only supported the serial protocol and had a bug in its implementation of this function.
-
I can not make it work.
The device responds to me with function code error.
Yet the manual it says it accepts the function (0x16)
I'm working with version "Advanced HMI 399r".
You must still update with the patch?
May I ask where you enter the value to be sent in the properties of "Pilotlight"? When I select the "OutputType = WriteValue"
Thanks again
-
I can not make it work.
The device responds to me with function code error.
Yet the manual it says it accepts the function (0x16)
May I ask where you enter the value to be sent in the properties of "Pilotlight"? When I select the "OutputType = WriteValue"
Output type of WriteValue will try to write an integer. You will need to use any of the other settings for it to set a bit. Did you get the patch installed?
-
in which directory should be installed the patch!
thank you so much
-
After unzipping the patch file, place it in AdvancedHMIDrivers\support to replace the existing file.
-
I'm sorry, but I can not make it work.
I also installed the patch, but not function.
Could you tell me where to write the value to be sent with the property OutputType = WriteValue?
For example if I want to send with the clik the value 2 as you do?
Excuse me, but the language creates problems in understanding.
Thank you
-
Use these property settings:
PLCAddressClick = 40001 (or any writable integer)
OutputType = WriteValue
ValueToWrite = 2
-
but in the properties of "Pilotlight" I do not find "ValuetoWrite"
I find it only in"BasicButton"
-
Archie,
I just tried using v3.99r with patch 3 and MOD RSSim2.
With several BasicButtons having different addresses and output types, I don't see any value change in the simulator.
Output types were: SetTrue, Toggle and WriteValue
Addresses were: 40011.1, 40011.14, 22:40011.1, 22:40011.14
ValueToWrite was set to 1.
-
My bad. It was version 1 of MOD RSSim that I was using.
Just tried version 2 and it was changing value.
-
I do not know how he funzionarti.
To me it does not work.
My starting address is 14200
BasicButton: 22:414200.10 get "address must be 4-11 digit"
BasicButton: 22:14200.10 I get "invalid address format"
Pilotlight 22:14200.10 get "write failed format of the input string incorrect"
-
The correct format should be: 414200.10.
The format that worked for me was: 40011.1 or 40011.14 ...
You shouldn't be using the WriteValue output type.
-
This format also works with read me.
But I just can not understand how to send a value to the property
"WriteValue"
When you select the WriteValue property, where you write the value to be sent?
-
What value are you looking to write?
Because you are looking to change a bit, the only values that are accepted are either "0" or "1".
That is why you need to change the OutputType property of the PilotLight to either:
- MomentarySet (write "1" to the destination address temporarily)
- MomentaryReset (write "0" to the destination address temporarily)
- SetTrue (write "1" to the destination address)
- SetFalse (write "0" to the destination address)
- Toggle (switch between "0" and "1" with every click)
-
Hello, I would write the "weight" (value) of the bit.
For example, bit 1 = 1; bit 2=2; bit 3 = 4; ........ bit 8 = 255 etc.
In this way we solve the problem.
I create many buttons (Pilotlight) for each bit to be set, without further complications.
I can do it with the clik event inserting the statement.
ModbusTCPCom1.Write ("address", value).
But I do not know if there is a suitable object properties.
Thanks for your patience
-
The PilotLight does not support the ValueToWrite property in the current version, you would have to use the BasicButton.
I will make sure the next release implements the property in the PilotLight
-
Just out of curiosity:
What "address" are you using in those statements: ModbusTCPCom1.Write ("address", value)?
The values that you want to write are not the actual bit values but integer values instead.
The address 414200.10 points to the bit level.
From my tests with MOD RSSim, even if I use a BasicButton, set its OutputType property to WriteValue and in the ValueToWrite property input any integer value greater than "0", it will still only write "1" to that address bit.
If you check the attached picture, all the buttons are set to WriteValue and the ValueToWrite is higher than "0" in each one of them (and goes as high as 14). Still, only the value of "1" was written to the bit. For reference, the "weight" of each bit is posted either above or below the button.
If I change the output type of all buttons to Toggle then I still get the same result but have a bit more control over changing the state of each bit.
-
Forgive the delay in reply.
Just out of curiosity:
What "address" are you using in those statements: ModbusTCPCom1.Write ("address", value)?
ModbusTCPCom1.Write ("6:14200", 1)
Bit1=true
Write: ModbusTCPCom1.Write ("6:14200", 2)
Bit2=true
Write: ModbusTCPCom1.Write ("6:14200", 4)
Bit3=true
ecc.
Sorry if my English is unclear
-
With writes like those, you are actually setting all bits at the same time.
I will use your example:
Write: ModbusTCPCom1.Write ("6:14200", 4)
Bit3=true
It is not only that you are setting Bit3 to True, you are also setting all other bits to False.
This because value 4 in binary is 0000000000000100.
If the previous value was 0000000000100000, by writing 4 to the address then you would set the Bit6 to False and also set Bit3 to True.
If your PilotLights have bit level addresses and you want to be able to use the ValueToWrite property (if Archie provides that functionality in the next release of AHMI), then you might get different results than you expect.
What I am trying to suggest is that, for your PilotLights, the PLCAddressClick field might need to be set as 414200 (integer value) and PLCAddressValue field might need to be set as 414200.10 (bit value).
-
I understand what you mean.
I know what happens by writing the "weight" of a single bit in a word.
Having to "raise" a single bit at a time in the word, is good for me to proceed in this way.
Differently I first read the value of the word, and then I added or subtracted the weight of the bit to be written.
*Ready Word
Value_Ready=ModbusTCPCom1.Read ("4:14200")
*Set Word
value_Write=Value_ready+bit_value
*Write Word
ModbusTCPCom1.Write ("6:14200", value_Write)