Is there a white paper available for the VB example that can help me in understanding the Syntax required to successfully read the inputs and write to the outputs.
All I need to do now is how to read the variables into VB From the pic and write to the variables in the pic.
VB and 18f4550
Moderator: Benj
-
- Flowcode V4 User
- Posts: 17
- Joined: Thu Jul 30, 2009 9:13 am
- Location: New Zealand
- Been thanked: 1 time
Re: VB and 18f4550
Can someone tell me if I am correct in analizing the following instruction
lRetVal = ECIO_Transmit(bDataOut(0), 3, nTxDataCnt, bDataIn(0), 32, nRxDataCnt, 500)
bDataOut(0) this is the number of the board
, 3, this is the macro 3 that will run ie the 3 condition in the service macro
The rest does not make sense to me
lRetVal = ECIO_Transmit(bDataOut(0), 3, nTxDataCnt, bDataIn(0), 32, nRxDataCnt, 500)
bDataOut(0) this is the number of the board
, 3, this is the macro 3 that will run ie the 3 condition in the service macro
The rest does not make sense to me
Regards
Roy
Roy
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: VB and 18f4550
Hello Roy
Ok here goes
lRetVal = ECIO_Transmit(bDataOut(0), 3, nTxDataCnt, bDataIn(0), 32, nRxDataCnt, 500)
Ok here goes
lRetVal = ECIO_Transmit(bDataOut(0), 3, nTxDataCnt, bDataIn(0), 32, nRxDataCnt, 500)
- lRetVal - Was the command succesful?
- bDataOut(0) - First byte in output data buffer
- 3 - Number of bytes to try and send
- nTxDataCnt - Actual number of bytes sent
- bDataIn(0) - First byte in input data buffer
- 32 - Number of bytes to try and read
- nRxDataCnt - Actual number of bytes received
- 500 - Maximum time to wait in milliseconds for the incoming data
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 17
- Joined: Thu Jul 30, 2009 9:13 am
- Location: New Zealand
- Been thanked: 1 time
Re: VB and 18f4550
Thks i will study it carefully
However once this data has been sent how in the flowcode macro do i analize this
if i could have an example of how to put on an output and read in an input say a analohue in
However once this data has been sent how in the flowcode macro do i analize this
if i could have an example of how to put on an output and read in an input say a analohue in
Regards
Roy
Roy
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: VB and 18f4550
Hello
In the flowcode macro you get the data as a string or as bytes. If you are reading as bytes then you will read the array sent fro the PC a byte at a time. If you are reading as a string then you will get the complete array.
Similarily with the send bytes or strings. These are the values used in the return values.
There are working examples for each of the USB components complete with VB source code so you should be able to see from these how the data is coming in and out of the system.
In the flowcode macro you get the data as a string or as bytes. If you are reading as bytes then you will read the array sent fro the PC a byte at a time. If you are reading as a string then you will get the complete array.
Similarily with the send bytes or strings. These are the values used in the return values.
There are working examples for each of the USB components complete with VB source code so you should be able to see from these how the data is coming in and out of the system.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 17
- Joined: Thu Jul 30, 2009 9:13 am
- Location: New Zealand
- Been thanked: 1 time
Re: VB and 18f4550
I have studied the examples and just cannot get it right, am I correct in saying the first 3 bytes sent are stored in the macro.a,macro.b and macro,c variables.
Macro.a determines the subroutine to be performed
Therefore if I send 0,0,50
We will output the first routine, setting outputs according the the macro.b value
Macro.a determines the subroutine to be performed
Therefore if I send 0,0,50
We will output the first routine, setting outputs according the the macro.b value
Regards
Roy
Roy
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: VB and 18f4550
Hello Roy
Yes in the 3 byte example the first three bytes are passed as the parameters A, B and C. This is defined in the properties of the USB component to match the properties of the slave service macro. You do not have to use these parameters and can instead use the Component Macro read functions if you wish. Examples demonstrating different functions of the slave service routine are also available from the examples folder.
Yes in the 3 byte example the first three bytes are passed as the parameters A, B and C. This is defined in the properties of the USB component to match the properties of the slave service macro. You do not have to use these parameters and can instead use the Component Macro read functions if you wish. Examples demonstrating different functions of the slave service routine are also available from the examples folder.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel