In reply to Lucho:
Looked up on web: will it work??
1:
Dim str As String
Dim num As Integer
str = "12345"
num = val(str)
2:
Dim v As Integer
v = Val("100 Blah Blah")
Print v ' prints 100
v = Val("Nothing")
Print v ' Could not convert, prints 0
Niklas Flykt
Klinkmann Oy
Key Account Manager safety products
nikfly@gmail.com
In reply to Niklas Flykt:
Niklas, This would not work as the requirement is to run in the controller and DeltaV controllers do not use VB. The CALC blocks use a Structured Text language with a slightly different syntax.
I wonder what the root issue is? The problem is not really converting a string to a number. it is detecting when a time threshold is exceeded, (> than 4 minutes) but we don't know anything about how this string is derived, where it comes from or if there isa better way for DeltaV to detect this threshold. Lucho might get more input from the community if he backed up and described the problem he is trying to solve, not the problem he has run into with his solution... Something to think about when posting on a forum like this one.
Andre Dicaire
In reply to Andre Dicaire:
Hi, tought we were talking about iFix VB ? In DV you have these standard functions to change time to string/numbers and so on... Just make a block and assign the "chopped" up time parts to the out put side.
Another option that can be used when the numbers are integers and there are less than 256 of them (like minutes 0 to 59) is to create a named set with the strings as names and values as the numbers. You can assign the string value to a parameter using .CVS and read back the number using .CV