Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

question trend

jbarrio
2017-10-31
2017-11-04
  • jbarrio - 2017-10-31

    I downloaded a sqlite file from the one that generates the trend ​​register, it gives me the time in TS and the value, but I do not know in what format it is returned because a value of 210 gives me a record of 1131986942 in the value field.

    best regards,

     
  • jbarrio - 2017-11-02

    hello:

    doing tests I have verified that the problem is with the real values since the database in sqlite is built with all the variables in type INT. Someone can help me that the database has the types corresponding to its variables or how to pass the value that gives you from a real variable the database to the real data.

    Thank you very much, it would be very helpful ...

     
  • jbarrio - 2017-11-03

    jbarrio hat geschrieben:
    hello:
    doing tests I have verified that the problem is with the real values since the database in sqlite is built with all the variables in type INT. Someone can help me that the database has the types corresponding to its variables or how to pass the value that gives you from a real variable the database to the real data.
    Thank you very much, it would be very helpful ...
    None?

    Enviado desde mi Plus E mediante Tapatalk

     
  • eschwellinger

    eschwellinger - 2017-11-04

    Hi,
    no clue what you are doning, this should simply work
    with out any probems.
    You need to give more Details or your project otherwise hard to try to help.

    BR
    Edwin

     
  • jbarrio - 2017-11-04

    hi:
    Sorry for not explaining myself well, my English is not good.
    I make a simple application with three variables with the same value (value=10) INT, REAL, LREAL in the visualization it looks perfect all read perfect.
    Now download /var/opt/codesys/Plcprogram/trend/Application.Test.sqlite ( the trend record is called Test).
    open this archive with mozilla firefox sqlite manager.
    The variable INT is record perfect, the records is 10
    The variable REAL, the records is 1092616192
    the variable LREAL, the records is 4621819117588972000

    my problem is that I do not know how to do this conversion and I need to save values with decimals.
    If something does not explain me well, tell me
    thank you very much for taking your time.

    IMG: program.PNG

    IMG: sqlite.PNG

     
  • josepmariarams - 2017-11-04

    If your real value (a) is strored in an int (intVal). Do:

    B:pointer to real;

    B:=adr(intVal)

    A:=B^

     
  • jbarrio - 2017-11-04

    very thanks !!!!!!!!!!!!!!!!

    very grateful for your help, now I can from codes and move from one to another.
    Do you know of any place where you can find documentation on how to make these calculations codesys to be able to do them in an excel sheet?

    very very thanks

     
  • josepmariarams - 2017-11-04

    There is'nt any calculation. We only have told the compiler that the 64 bits are a real number representation.

     
  • josepmariarams - 2017-11-04

    You can do the same using a union with an integer and one real.

     

Log in to post a comment.