Support Forums
Create digital tags from single modbus register

Hello vt scada community. New user here. I am looking for assistance to create several digital tags based off the value of a single Modbus register. For example, register 40001 value =1 is "pump running". Same register 40001 value =2 is "pump stopped". How can I accomplish this with minimal tag usage? Thank you

Hello vt scada community. New user here. I am looking for assistance to create several digital tags based off the value of a single Modbus register. For example, register 40001 value =1 is "pump running". Same register 40001 value =2 is "pump stopped". How can I accomplish this with minimal tag usage? Thank you

Version 12: Use an IO & Calculation tag in Discrete mode with Read Address as 40001.

Version 11: Use an Analog Status tag with IO address of 40001.

There are many ways you can display the values you are mapping out. Text with ternary expression chains (value == 1 ? "Value 1" : Value == 2 ? "Value 2" ... etc.) or one of the built-in 4 state or multi-state widgets would be fine.

Version 12: Use an IO & Calculation tag in Discrete mode with Read Address as 40001. Version 11: Use an Analog Status tag with IO address of 40001. There are many ways you can display the values you are mapping out. Text with ternary expression chains (value == 1 ? "Value 1" : Value == 2 ? "Value 2" ... etc.) or one of the built-in 4 state or multi-state widgets would be fine.

Thank you, I should have more descriptive in my initital post. The register will have more than 2 states and thus a discrete tag would not be able to show me all of them. The register actually has 11 different states and I would need to indicate which one is active based on the value of the register. So continuing my example above, register 40001 value 3 is "pump alarm" value 4 is "pump overload" etc.... Can you give me an example of how to do this? I believe I should be able to use one I/O tag to read the 40001 register and then create 11 seperate tags for each state and "trigger" them when their value is in 40001. I am used to other SCADA softwares so VTscadaLight is a little foreign to me. I have utilized the F1 help feature but still stuck, I am using the latest 12.0.03. Thank you for your help.

Thank you, I should have more descriptive in my initital post. The register will have more than 2 states and thus a discrete tag would not be able to show me all of them. The register actually has 11 different states and I would need to indicate which one is active based on the value of the register. So continuing my example above, register 40001 value 3 is "pump alarm" value 4 is "pump overload" etc.... Can you give me an example of how to do this? I believe I should be able to use one I/O tag to read the 40001 register and then create 11 seperate tags for each state and "trigger" them when their value is in 40001. I am used to other SCADA softwares so VTscadaLight is a little foreign to me. I have utilized the F1 help feature but still stuck, I am using the latest 12.0.03. Thank you for your help.

I should note that I would like these to display on the trend as a digital and not as an analog. I have figured out how to use a numeric calculation expression to show these as an analog on the trend but I want them as a digital. Any ideas? Thank you

I should note that I would like these to display on the trend as a digital and not as an analog. I have figured out how to use a numeric calculation expression to show these as an analog on the trend but I want them as a digital. Any ideas? Thank you

Bit Addressing

An individual bit in a register (either an Input Register or a Holding Coil) may be read or written (for Holding Coils) by appending the address with "/x" where x has a value from 0 to 15 and indicates which bit is to be used. For writes, a read\modify\write cycle is used on the register as the Modicon protocol does not have a bit operation function.

If you are working with long integers, append the text "/sdword" after the bit number. For example: "40050/1/sdword".

Bit Addressing An individual bit in a register (either an Input Register or a Holding Coil) may be read or written (for Holding Coils) by appending the address with "/x" where x has a value from 0 to 15 and indicates which bit is to be used. For writes, a read\modify\write cycle is used on the register as the Modicon protocol does not have a bit operation function. If you are working with long integers, append the text "/sdword" after the bit number. For example: "40050/1/sdword".

Century Control Systems, Inc. www.centurycontrolsystems-inc.com

Thanks Mel, I am trying to read the analog value of the register and decipher the state based on its value. Here is the actual register and associated "states". I need to read each of these states and trend them as a digital so that I can determine a "timeline" of when states are active. I can successfully read the value, I just need to figure out how to trend them as digital not analog. The second pic is my actual setup where the tag "Load Control Mode" is my analog I/O that reads the value and I have created the three child tags as Numeric calculation type . My only problem now is they plot as analogs and not digitals. How can I make them plot as digital? Thank you.

5df98564aecf9

5df9841b99d52

Thanks Mel, I am trying to read the analog value of the register and decipher the state based on its value. Here is the actual register and associated "states". I need to read each of these states and trend them as a digital so that I can determine a "timeline" of when states are active. I can successfully read the value, I just need to figure out how to trend them as digital not analog. The second pic is my actual setup where the tag "Load Control Mode" is my analog I/O that reads the value and I have created the three child tags as Numeric calculation type . My only problem now is they plot as analogs and not digitals. How can I make them plot as digital? Thank you. ![5df98564aecf9](serve/attachment&path=5df98564aecf9) ![5df9841b99d52](serve/attachment&path=5df9841b99d52)

Discrete (not digital) tags can hold any number of values.

But if you need these to be trended as a digital then you need to use individual bits. You can keep this to one licensed tag by using a Discrete IO tag to read the full register and then multiple String Calculation tags with expressions mapped to the states that you want to trend as 0 or 1.

Discrete (not digital) tags can hold any number of values. But if you need these to be trended as a digital then you need to use individual bits. You can keep this to one licensed tag by using a Discrete IO tag to read the full register and then multiple String Calculation tags with expressions mapped to the states that you want to trend as 0 or 1.
edited Dec 18 '19 at 3:46 am

Can I manipulate digitals via scripting without using an address? I want to use just one IO to get the data then toggle a digital tag so it will plot as a digital. This device rapidly toggles between modes(0-11 above) which changes the value of the single register(450058, My whole goal is to create a timing chart of the modes on the trend plot like shown. These are digital IO tags for other status points I am monitoring but it shows what I am trying to accomplish, thanks.

5df9ab115eca1

Can I manipulate digitals via scripting without using an address? I want to use just one IO to get the data then toggle a digital tag so it will plot as a digital. This device rapidly toggles between modes(0-11 above) which changes the value of the single register(450058, My whole goal is to create a timing chart of the modes on the trend plot like shown. These are digital IO tags for other status points I am monitoring but it shows what I am trying to accomplish, thanks. ![5df9ab115eca1](serve/attachment&path=5df9ab115eca1)

You can make a calculation tag to represent each state. I would make a I/O and calculation tag (in numeric calculation mode) as a child tag to a Discrete I/O tag which is pointed to your address.

In each calculation, I would use the following expression: ..\Value == 1 ? 1 : 0
Where == x is the discrete value of the parent tag making the calculation go to 1 if the condition is true.

Does that make sense?

You can make a calculation tag to represent each state. I would make a I/O and calculation tag (in numeric calculation mode) as a child tag to a Discrete I/O tag which is pointed to your address. In each calculation, I would use the following expression: ..\Value == 1 ? 1 : 0 Where == x is the discrete value of the parent tag making the calculation go to 1 if the condition is true. Does that make sense?

Trihedral Engineering Ltd.

Can I manipulate digitals via scripting without using an address? I want to use just one IO to get the data then toggle a digital tag so it will plot as a digital. This device rapidly toggles between modes(0-11 above) which changes the value of the single register(450058, My whole goal is to create a timing chart of the modes on the trend plot like shown. These are digital IO tags for other status points I am monitoring but it shows what I am trying to accomplish, thanks.

5df9ab115eca1

Yes, that makes perfect sense and is how I am configured, however my issue is not obtaining the data and I am not using any graphical widgets. My focus is strictly on the Historical Data Viewer(HDV) and my dilemma is how they are displayed in the HDV. I want to be able to track all the binary states in the HDV so I can quickly tell which on is on by showing them as a digital type. The digital stack nice and compactly on top one another and gives me a quick indication . However, using the method above defaults the tags to an analog type which provides a "large" Y axis scale that takes up too much space. Two questions, 1) can I assign a digital tag type via script(or other method) using the value of the numerical calculation tag above? Or 2) is there a way to remove/condense the Y axis of the individual analog graphs to save space? I have adjusted everything I can find on the Y axis but no luck. See screenshot below to clarify what I am looking for, Thank you for all your support!!

5dfbe39adf495

Can I manipulate digitals via scripting without using an address? I want to use just one IO to get the data then toggle a digital tag so it will plot as a digital. This device rapidly toggles between modes(0-11 above) which changes the value of the single register(450058, My whole goal is to create a timing chart of the modes on the trend plot like shown. These are digital IO tags for other status points I am monitoring but it shows what I am trying to accomplish, thanks. ![5df9ab115eca1](serve/attachment&path=5df9ab115eca1) Yes, that makes perfect sense and is how I am configured, however my issue is not obtaining the data and I am not using any graphical widgets. My focus is strictly on the Historical Data Viewer(HDV) and my dilemma is how they are displayed in the HDV. I want to be able to track all the binary states in the HDV so I can quickly tell which on is on by showing them as a digital type. The digital stack nice and compactly on top one another and gives me a quick indication . However, using the method above defaults the tags to an analog type which provides a "large" Y axis scale that takes up too much space. Two questions, 1) can I assign a digital tag type via script(or other method) using the value of the numerical calculation tag above? Or 2) is there a way to remove/condense the Y axis of the individual analog graphs to save space? I have adjusted everything I can find on the Y axis but no luck. See screenshot below to clarify what I am looking for, Thank you for all your support!! ![5dfbe39adf495](serve/attachment&path=5dfbe39adf495)
89
9
4
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft