Applies To:
  • CitectSCADA 3.30 4.10

Summary:
Various customers have asked to allow variable tags starting with numbers. In the past Citect has not supported variables tags starting with numbers as it is not a good engineering practice. Tags starting with numbers are not supported by modern programming languages and they are not allowed in the industrial control systems standard IEC 1131-3. The reason this is the case is because it creates confusion when tags are used in complex expressions. This was not a problem with older simpler systems when you could only get the value of a tag.

I don't recommend you use tags starting with number for new projects. The only reason we have supported tags starting with numbers is for clients who have large existing databases which use these tags are converting them to Citect.

 

Solution:
The support for tags starting with numbers has been added in version 3.30 and 4.10 and is enabled by the following parameter:

[general]
TagStartDigit=1

Default is 0, set to 1 to enable tags.

We only support variable tags and cicode variables starting with numbers. You cannot start labels or label arguments with numbers. As Citect supports several types of numbers there can be confusion with tags starting with number clashing with the special types of numbers. For example the following may look like tags:

0X1234 is hex number
0B0011 is binary number
0O7777 is octal number
0E23 is floating point number

When the TagStartDigit is set to 0 the above tags are treated as valid numbers. However it was decided that a user may feel that 0E12334 is a tag and not a floating point number. We can resolve this clash by forcing users to include a decimal point in all floats. So we make the float format much more rigid when this option is enabled. So 0E23 is a tag and 0.E23 is a float when the TagStartDigit parameter is enabled.

This leaves the 0O01234567 (that's an O as in Orange) and 0X01234, 0B01 clashes. We cannot remove support for these types as they are used in various places in the supplied cicode libraries. The solution is to make them case sensitive. That is 0x10 is hex number and 0X10 is a tag. Also if you have lower case and the number is illegal we will assume a tag. For example:

0xG G is not valid hex digit.
0b2 2 is not valid binary digit.
0o8 8 is not valid octal digit.
0x123456789 more than 8 digits for 4 byte integer

Because of the above problems you cannot define tags which look like valid numbers. For example 0x123 will be treated as a number not a tag. So you should always use upper case for tags starting with a number and the tag must contain at least one alpha (A..Z) or underscore (_) character.

Also you cannot define numbers which look like tags. When TagStartDigit=0, then 0X123 will be treated as a hex number. When TagStartDigit=1 then 0X123 will be treated as a tag. This can cause problems if you have existing cicode from older projects which has numbers defined this way. When you switch this option on, you may find you will get the "Tag not found" compiler error. This will occur because Citect will think that some of your numbers are tags and so try to find them in the Tag database.

 

Keywords:
 

Attachments