Couple of things:
In your Bed1Trend() your missing your parameters in the StrToTime call
Time() is a function and should be called as a function rather than a variable so add some brackets in both Bed1Start and Bed1Trend
If your tag is defined on a disk device you don't need to instantiate it in your code as an INT. Not sure if that is a problem but anything declared in a function normally won't be accessible to other functions.
Using the disk devices can be annoying with the addressing. I never worked out a good way to know which addresses are used but in newer versions of citect (2016 and above) the tag editor makes it a bit more obvious because you can sort by ascending and see the i2, i3, i4 etc in order. To be safe choose a high number maybe i200 or something as your address or depending on how many tags there are scroll through and find a gap
Alternatively you can store the tag in an actual PLC which might be easier.
In your Bed1Trend() your missing your parameters in the StrToTime call
Time() is a function and should be called as a function rather than a variable so add some brackets in both Bed1Start and Bed1Trend
If your tag is defined on a disk device you don't need to instantiate it in your code as an INT. Not sure if that is a problem but anything declared in a function normally won't be accessible to other functions.
Using the disk devices can be annoying with the addressing. I never worked out a good way to know which addresses are used but in newer versions of citect (2016 and above) the tag editor makes it a bit more obvious because you can sort by ascending and see the i2, i3, i4 etc in order. To be safe choose a high number maybe i200 or something as your address or depending on how many tags there are scroll through and find a gap
Alternatively you can store the tag in an actual PLC which might be easier.