Re: Real numbers via rs-232
is it a 4-digit number, or a 4-byte LONG number?
Re: Real numbers via rs-232
I was told it is a 4 byte real number. When I view it as ASCII it does not make any real sense as to how to convert it. The PLC stores the data in BCD as well and I have taken that data to compare it to the real number value and cannot see how they relate. Unfortunately the BCD location will change so I cannot use that for my program.
Wish I had more information to give you, but that is all I have.
Thanks
Re: Real numbers via rs-232
Quote:
Originally Posted by tipper
I was told it is a 4 byte real number. When I view it as ASCII it does not make any real sense as to how to convert it. The PLC stores the data in BCD as well and I have taken that data to compare it to the real number value and cannot see how they relate. Unfortunately the BCD location will change so I cannot use that for my program.
Wish I had more information to give you, but that is all I have.
Thanks
http://www.ray.masmcode.com/tutorial/fpuchap2.htm#real4
Re: Real numbers via rs-232
Thanks,
I read throught the article and now I understand what I am getting. It also gives me an idea of what I have to do to either convert it manually, or revise the way I am bringing in the data to hopefully get VB to do it for me.
Jerry
Re: Real numbers via rs-232
i find it hard to believe that it is giving you a floating point number. Convert it to binary and post it here. We'll look at it for you.
Re: Real numbers via rs-232
Quote:
Originally Posted by tipper
Thanks,
I read throught the article and now I understand what I am getting. It also gives me an idea of what I have to do to either convert it manually, or revise the way I am bringing in the data to hopefully get VB to do it for me.
Jerry
If I'm not mistaken a 4 byte real is a visual basic single.