Applies To:
  • CitectSCADA 6.00
  • CitectHMI 6.00

I have upgraded my project to CitectSCADA Version 6.00. Since doing this I get a hardware alarm "Invalid argument passed" when I use StrToTime(). Also, TrendSetSpan() does not seem to work as it did in previous versions.

The StrToTime cicode function converts 'time' values, passed as a string in the format hh:mm:ss, to seconds. It is often used within the TrnSetSpan function to set the span of a trend page. Prior to CitectSCADA Version 6, values of 24 hours and greater could be entered. In Version 6, the maximum time value that can be entered is "23:59:59".

If you need the function to accept values greater than this then use StrToPeriod instead. It works similarly except that you cannot omit right-hand fields if they are 0. For example, 20 hours 0 minutes 0 seconds must be passed as "20:00:00", rather than just "20" as could have been passed into StrToTime. StrToPeriod will regard "20" to mean 20 seconds only. This is important to note as the function TrendSetSpan (not to be confused with TrnSetSpan) in in the Version 6.00 Include Project now uses StrToPeriod rather than StrToTime. Accordingly, right-hand fields should not be omitted if they are zero when being entered into the number pad created by TrendSetSpan.

StrToTime, StrToPeriod, TrnSetSpan, TrendSetSpan