Applies To:
  • CitectSCADA 3.00

Summary:
Question: No error was returned when TagRead was used on a non-existent tag while the real PLC was offline. It also created a hardware alarm although I'm not sure whether it should do this or not. Is this correct? 

Solution:
TagRead() will return the value of the tag you want to read. So it cannot return an error code because you would assume that this is the value of the tag. If you try to read a tag which does not exist then a hardware error is generated. You may also check the value of the IsError() function and disable the hardware errors as follows:

ErrSet(1);
sValue = TagRead("BadTag");
IF IsError() THEN
   // the tag is bad
END
ErrSet(0);

 

Keywords:
 

Attachments