This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

dt.uint64
#9
This example writes a numeric value in double floating point format using raw datatype. If the resulting value is incorrect try removing the line with reverse() call.

Code:
val = 123456.67890

ffi = require('ffi')

dst = ffi.new('unsigned char[8]')
src = ffi.new('double[1]')

src[ 0 ] = tonumber(val) or 0

ffi.copy(dst, src, 8)

res = ffi.string(dst, 8)
res = res:reverse()

grp.write('2/2/2', res, dt.raw)
Reply


Messages In This Thread
dt.uint64 - by DGrandes - 08.07.2022, 09:30
RE: dt.uint64 - by admin - 08.07.2022, 09:35
RE: dt.uint64 - by DGrandes - 08.07.2022, 10:04
RE: dt.uint64 - by admin - 08.07.2022, 10:52
RE: dt.uint64 - by DGrandes - 08.07.2022, 11:13
RE: dt.uint64 - by manos@dynamitec - 19.02.2024, 23:40
RE: dt.uint64 - by admin - 20.02.2024, 06:30
RE: dt.uint64 - by manos@dynamitec - 20.02.2024, 08:33
RE: dt.uint64 - by admin - 20.02.2024, 09:01
RE: dt.uint64 - by manos@dynamitec - 20.02.2024, 09:38
RE: dt.uint64 - by admin - 20.02.2024, 09:46
RE: dt.uint64 - by manos@dynamitec - 20.02.2024, 10:08
RE: dt.uint64 - by admin - 20.02.2024, 10:13
RE: dt.uint64 - by manos@dynamitec - 20.02.2024, 11:01

Forum Jump: