OMF stands for OSIsoft message format so that is a specification done by OSIsoft
and it's basically just a specification on how to write data to certain endpoints. In
this case we're gonna write data to OCS so it's a specification of how to send the data
so it's like a format you can use. So this is the documentation for OMF and this is
so the link is present in appendix D and in OMF there are three main types of messages
we send and remember OMF only sends data back either to the PI Ssystem or to OCS and in this
case so it only sends data it's not used to read data only writes data basically.
So we have the the main components of an OCS message, sorry of an OMF message are first the
headers so I need to specify the header and most importantly you need to specify the message type.
So you need to specify if you're sending a type or a container or data and we're going to talk about
these and you need to specify what is the action. The rest is usually the same for all types of OMF
messages, so again in the message type either specify if it's a type, a container or data and
in the action you specify what you want to do so if it's creating or updating or deleting.
So that's what you pass in the headers so again we have three message types so if we
look at type messages, so type messages are when you're creating a type so in OCS if you want to
create a type like float32 or a different type or the types we see here in OCS basically go
to the sequential data source so these kinds of types which we've already created using
the OCS agent. So you can create your own type using OMF and this is an example. In
the documentation it's it's pretty detailed so you can check all the parameters you can pass
or you can check the example as well which was an example of passing a type creating
a type basically so you can see the header you pass again in the header you specify a
message type of type and action is create so basically we're creating a type here so you
can see here how to create a type so it needs an ID, version, type, classification and then
the properties. Okay so these are basically the attributes or the properties of the type.
You can create more than one parameter so in this case the first one is plant the second one is
tank that's all different types you're creating here and each type has several properties so in
this message we're basically creating several types one for plant, one for tank and another
one tank measurement and so on and each one has its own properties. So that's for type messages.
Container messages, a container is like a tag or for OCS it's a stream okay so we can check
an example here as well so again the message type has to be container and then in the body
you specify in this case we're creating two OCS streams so that's one stream and that's
the other stream. So that's for containers so in terms of OCS containers are streams and for data,
data is the values you want to send to a stream so we can look at an example here so again in
the message type you specify data and this is where you specify the data you wanna send so you
have to make sure you're pointing to the ID and then the values. Yeah that's another one here,
so you're pointing to the type ID and then you specify the different values and the
important thing is to specify the container ID so that you know to which tag you're sending
those values. So that's the stream basically. Okay so this is another set again you specify
a container ID and then the values. Okay so those are like the three main types you can use in OMF.
In OCS we have an OMF editor so you can use that to check some sample messages so that's again type
container or data and you can test your OMF before sending it you can test the OMF script or in this
case if you go to one of the type messages so you can copy this and paste it over here and
this basically checks if the OMF is okay so it says here it's a valid OMF if there's an error
it's gonna show. Okay so if you write something or miss one of the braces it's gonna show that
there's an error. So that what this is for, so it validates your OMF and checks if it's okay.
So that yeah again so that's for type,
there's for container and the same thing you can test your container messages and for data.