Frequently Asked Questions – Tags
Yes, using the OPC Systems component. The most effective method to set up multiple tags in one call is the TagCSVImport method as demonstrated in the Programmatic Interface topic in .NET Configuration – Programmatic Access Tags.
Yes, set the Data Type of the Open Automation Software Tag to Signed Byte, Unsigned Byte, Short Integer, Unsigned Short Integer, Integer, Unsigned Integer, Long, or Unsigned Long. When browsing for a Tag in a client application Bit00 up to Bit63 will be available selection immediately under the Value property.
myTag.Bit00 is an example of providing read and write access to bit 0 of an integer value.
View the OPC Communications – Troubleshooting section in this file on how to resolve all OPC Server communication errors.
A CSV Export and Import does not work when running on a system with Regional Language settings use a comma as a decimal holder.
Because the OAS Service runs under the SYSTEM Account it is not using the Regional Language settings. In some operating systems when you change the Regional Language the SYSTEM account is not updated. To correct this go to Region and Language under Control Panel, and select the Administrative tab.
Select Copy settings and select the option to Copy your current settings to: Welcome screen and system accounts and select OK.
Restart the OAS Services or restart the operating system.
The CSV export and import will now use your decimal separator selected for the operating system.
We have accumulative value and we want to take Delta for this accumulative value at end of each hour. For example value at start of the hour is 100 and at the end of the hour it is 150, so Delta is 50 for this specific hour. How we can use calculation tag option to achieve it?
First create a String Tag called DateTime with the Data Source of DateTimeString.
Next create a Double Tag called InitialValue with the Data Source of Calculation and the following Calculation.
IF(SUBSTR([DateTime.Value],STRLEN([DateTime.Value])-5,5) = “00:00”,[SourceTag.Value],[InitialValue.Value])
Then you have a second Double Calculation Tag called TheDifference with the following Calculation.
A third Calculation Tag called LastHour can be used to hold the last hour’s result.
IF(SUBSTR([DateTime.Value],STRLEN([DateTime.Value])-5,5) = “59:59”,[TheDifference.Value],[LastHour.Value])
Create a Calculation Tag with the following Calculation.
STRFORMAT([myTagValueTimeOnTotal]%60,”00″)&”:”&STRFORMAT(MOD([myTagValueTimeOnTotal],60),”00″)&”:”&STRFORMAT(([myTagValueTimeOnTotal] – ([myTagValueTimeOnTotal]%60)*60 – MOD([myTagValueTimeOnTotal],60))*60,”00″)
- Create a Tag called DateAndTime with the Date Type of String and the Data Source of DateTimeString.
- Modify the Calculation in both Reset tags to the following.
IF(SUBSTR([DateAndTime.Value],STRLEN([DateAndTime.Value])-8,8) = “07:00:00”,1,0)|IF(SUBSTR([DateAndTime.Value],STRLEN([DateAndTime.Value])-8,8) = “15:00:00”,1,0)|IF(SUBSTR([DateAndTime.Value],STRLEN([DateAndTime.Value])-8,8) = “23:00:00”,1,0)
Use the Time On and Counts property.
The error is related to the security setting in the PLC. Follow these steps in Step 7 (TIA Portal): Siemens Security Setup