OPC item type problem

I’m using FSQL 4.2.11 with Kepware V5.4 and I have some OPC item’s problem.
I load in Kepware a serie of OPC tags wich is “Word” data type. When I’m looking to these tags with FSQL, they appearded to be “Integers”. Whatever data type I assign in Kepware, FSQL change it to “UInt(2)”. If I’m trying to write a string in one of these tag in FSQL, it show an error message saying :
The value "my value"could not be converted to the type of the item (‘UInt(2)’). Which I can understand because FSQL is waiting for an integer but in Kepware the data type is “Word”.
Do you have any idea why this happen?
Thanks for your help

Mio Vaillancourt-Thivierge

Is it a problem that you never had? I’ll be proud if I found something that you don’t have the answer! :wink:
Or maybe it is too simple and you think I’ll figure out myself!
Regards,

Mio Thivierge

Oops, sorry for the late response! I was just saying that I shouldn’t read the forum unless I’m ready to respond, because once I move on, I forget about outstanding threads. Anyhow…

I don’t really follow exactly what’s happening to the data types. They came in as integers but you changed them to be UInt2?

Here’s the thing: The data type in FactorySQL is pretty flexible. It gets used to create the db column, and then it gets sent to the OPC server as a hint for what type of data to send back. This can be turned off from the Service Settings section by un-checking “request data types”, but I don’t think that is what is causing your problem.

You say that you can’t write a string- what do you mean exactly? Where is the string coming from, the database? Or are you right-clicking and selecting “write value” in FactorySQL? I assume you mean the “string version of a number”, ie. “14”, but let me know if you mean something else.

I would recommend setting the data type to “Integer” in FactorySQL. UInts can sometimes be a little bit more difficult to work with.

Regards,

No problems!
I didn’t change anything, in fact I think maybe FSQL change the type of the variable from “Word” to “UInt(2)”. I’m don’t know why and I’m not sure too. I tryed un-checking that box but it doesn’t change anything. However I found an another way to get what I want from FactorySQL.
I was effectively meaning the “write value” command. But instead of entering a string, as I first tought, I change the conception and use an unsigned integer. Less complicated and it do the same thing.
No trouble yet with the UInt(2) but I keep in mind you recommandation.
Thanks for your time it’s really appreciate.
Mio Vaillancourt-Thivierge