Rouhart Leopold Posted August 23, 2004 Report Share Posted August 23, 2004 Salut, How to can convert one value type LabVIEW data TIMESTAMP ( Controls->Numeric->Time Stamp Control ) for inserting this value into one TIMESTAMP data field for DataBase SQLAnywhere 9. When my VI run I'm receive a error "Error when convert binary to timestamp format" I'm appreciate your help. Thank's Leopold Rouhart leopold.rouhart@mil.be Quote Link to comment
David Boyd Posted August 23, 2004 Report Share Posted August 23, 2004 How to can convert one value type LabVIEW data TIMESTAMP ( Controls->Numeric->Time Stamp Control ) for inserting this value into one TIMESTAMP data field for DataBase SQLAnywhere 9. 1523[/snapback] Leopold, If you could provide more information about the datatype expected by the call into the SQLAnywhere code, that would be helpful. Until then, I have attached a VI (saved in LV7.0) which demonstrates conversion from the LV timestamp into an OLE Variant (used by ActiveX-based database tools, such as NI's Database Connectivity Toolkit). The VI also converts the OLE Variant back to the LV datatype. It may or may not be relevant as an example, depending upon your call interface. Hope this is useful to you. If not, describe your code in greater detail and perhaps someone on the user group can determine what needs to happen. Best regards, Dave Download File:post-195-1093285147.vi Quote Link to comment
snooper Posted October 29, 2004 Report Share Posted October 29, 2004 Leopold,If you could provide more information about the datatype expected by the call into the SQLAnywhere code, that would be helpful. Until then, I have attached a VI (saved in LV7.0) which demonstrates conversion from the LV timestamp into an OLE Variant (used by ActiveX-based database tools, such as NI's Database Connectivity Toolkit). The VI also converts the OLE Variant back to the LV datatype. It may or may not be relevant as an example, depending upon your call interface. Hope this is useful to you. If not, describe your code in greater detail and perhaps someone on the user group can determine what needs to happen. Best regards, Dave 1526[/snapback] HI, converting labview timestamps to a database format is not easy. The first thing to do is to convert the labview timestamp to a DBL so you have the number of seconds sinds a certain startdata. Now you have to find some documentation about the startdate of the database you are using. substract/add the difference between labview and your database to have a correct value. Please note that the timestamp field is not always a real date/time it also could be a syncronisation bit as used in the SQL SERVER timestamp implementation. You might consider using a float;real for timestamp control. You can also have a look at the New LabVIEW Database Toolkit at www.tm-solutions.nl/eng Greetz Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.