Function RecvAryReal(dataBuf() As Double) As Long
Dim x As Long
' this are special function for byte array doings
' if we want to delimeter the code
' this helps us then complex communication with
' the enc28j60 connected µC device
' receive DOS format 64bit binary data
Dim buf As String * 20
Dim size As Long
Dim length As Long
Dim count As Long
' this is special for communicate with
' OSZ or other devices later
' .. ;-)
Dim recvBuf(25616) As Byte
' receive header info "ROY<##"
' we can setup here our Startcode too
' but we do this in the "worker makro later"
x = recv(socketId, buf, 8, 0)
size = Val(Mid$(buf, 3, 6))
count = 0
length = 0
Do While length < size
DoEvents
count = recvB(socketId, recvBuf(length), size - length, 0)
If (count > 0) Then
length = length + count
End If
Loop
' receive ending LF
count = recv(socketId, buf, 1, 0)
' copy recieved data to Single type array dataBuf()
CopyMemory dataBuf(LBound(dataBuf)), recvBuf(0), length
'dataBuf = recvBuf
RecvAryReal = length / 8
End Function
Function RecvAryReal(dataBuf() As Double) As Long
VBA does not do a type conversion in this case. You need to pass the necessary array instead of a string.
ASKER
Dim strData As Byte
Function RecvAryReal(dataBuf() As Double) As Long
You must pass an array of double.
ASKER
ASKER
Private Sub CmdCread_Click()
On Error GoTo Err_Handler
Dim db As DAO.Database
Dim Rs As DAO.Recordset
Dim x As Long
Dim p As Long
Dim n As Long
Dim strData() As Double
Dim json As Object
Dim Details As Variant
Dim Z As Long
Dim strFindata As String
Dim strDataAudit As String
p = RecvAryReal(strData)
n = FreeFile()
Open "C:\Users\chris.hankwembo\Desktop\WinTesting\Test.txt" For Output As #n
Print #n, ShowHex(RecvAryReal(strData))
Close #n
MsgBox "strData:" & vbCrLf & ShowHex(RecvAryReal(strData))
ASKER
Dim strData() As Double
p = RecvAryReal(strData)
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
Open in new window