String Compare Function not working with RS232
Posted: Sun Aug 09, 2020 5:11 pm
Hi all,
I have been a Flowcode user for many years and I have been stuck on an issue for several weeks now. I have tried as many things as I can think of/found on these forums to no avail, please help!
I have 2 RF modules, one is a tx and one is a rx on a separate circuit. When a button is pressed on the tx, I send a short string of data ("VB") via the rf module. The receiving product then looks for this String of data and if it receives it, it will then fire a Xenon Tube for a specified period of time based on 5 inputs been on or off.
To do this I am using an RS232 interface. It is configured and enabled then the transmitting part sends "VB" if a button is pressed. The receiving end looks for this and if "VB" is received it sends a output macro and fires the Xenon tube. I have had success doing this using the SendChar macro for the RS232 component, however its not as clean or as fast as a String, its also very susceptible to radio noise so it is not ideal. I have also had success doing this by just sending 1's and 0's in a pattern as outputs, but obviously this also is not very good with regards to noise filtering either. This is where I would like to use a String, the data is very clean and very fast on my oscilloscope on both the Tx and Rx circuits.
I have successfully set up the programs to send and receive the String. This is clear in my oscilloscope, the transmitting radio module is sending the String when the button is pressed and the receiving circuit is receiving the exact same string. My issue is the Compare$ function just is not working, no matter what I do.
I am using a decision with $compare (Str1, "VB", 0) == 0 as a decision block to trigger the event, however it never works.
I have a test LED wired up to my output port and it never blinks and the Xenon tube never fires. The data the receiving Rx module is receiving is the exact same data the Tx module is transmitting on my oscilloscope, so I really do not understand why this is not working as the compare output should be 0. I have tried the compare string as a calculation to a variable as well before a decision block to no avail. I have also tried a numerical String such as "1024", but this also has the same problem. I have tried using the UART channel 1 on the IC as well as the digital channel on Flowcode for the RS232, both with the same result.
I have attached my flowcode files, I really hope someone can help me.
I am currently using the Trial version of Flowcode 8 with the intention of buying a full licence at the end of the trial period once I resolve this issue. I have been a Flowcode 5 user for several years and thought it was time to try the latest version.
Thank you in advance!
I have been a Flowcode user for many years and I have been stuck on an issue for several weeks now. I have tried as many things as I can think of/found on these forums to no avail, please help!
I have 2 RF modules, one is a tx and one is a rx on a separate circuit. When a button is pressed on the tx, I send a short string of data ("VB") via the rf module. The receiving product then looks for this String of data and if it receives it, it will then fire a Xenon Tube for a specified period of time based on 5 inputs been on or off.
To do this I am using an RS232 interface. It is configured and enabled then the transmitting part sends "VB" if a button is pressed. The receiving end looks for this and if "VB" is received it sends a output macro and fires the Xenon tube. I have had success doing this using the SendChar macro for the RS232 component, however its not as clean or as fast as a String, its also very susceptible to radio noise so it is not ideal. I have also had success doing this by just sending 1's and 0's in a pattern as outputs, but obviously this also is not very good with regards to noise filtering either. This is where I would like to use a String, the data is very clean and very fast on my oscilloscope on both the Tx and Rx circuits.
I have successfully set up the programs to send and receive the String. This is clear in my oscilloscope, the transmitting radio module is sending the String when the button is pressed and the receiving circuit is receiving the exact same string. My issue is the Compare$ function just is not working, no matter what I do.
I am using a decision with $compare (Str1, "VB", 0) == 0 as a decision block to trigger the event, however it never works.
I have a test LED wired up to my output port and it never blinks and the Xenon tube never fires. The data the receiving Rx module is receiving is the exact same data the Tx module is transmitting on my oscilloscope, so I really do not understand why this is not working as the compare output should be 0. I have tried the compare string as a calculation to a variable as well before a decision block to no avail. I have also tried a numerical String such as "1024", but this also has the same problem. I have tried using the UART channel 1 on the IC as well as the digital channel on Flowcode for the RS232, both with the same result.
I have attached my flowcode files, I really hope someone can help me.
I am currently using the Trial version of Flowcode 8 with the intention of buying a full licence at the end of the trial period once I resolve this issue. I have been a Flowcode 5 user for several years and thought it was time to try the latest version.
Thank you in advance!