-------------------------------------------- CONPROSYS Script 100 No.021 -------------------------------------------- Process name: LoRa Transmission and Reception routine Date of creation: March. 12, 2018 Processing content: Transmit data that is received by LoRa Reception and Transmission. After transmitting, receive a response from transmission destination. [Signals] None [Operation] 1. Create a data format to transmit * In the sample, the following data are stored and added by Calc Sring to LSTAG00. - [X : 2, Y : 2] LSTAG00 = 0001 -> Set Transmission destination ID as 0001. - [X : 2, Y : 3] LSTAG00 += 0001 -> Add Transmission destination address as 0001 - [X : 2, Y : 4] LSTAG00 += TEST -> Add Input data as TEST - [X : 2, Y : 5] LSTAG00 += CR+LF -> Add CRLF 2. Transmit the created data (LSTAG00) to link-0. 3DAfter transmission, wait until CR code comes from link-0 while linking the reception data. 4. Determine the reception data after receiving the CR code. Processing the data according to the type - [X : 6, Y : 2]( OK ) : Move to a waiting state to receive the output data transmitted from a remote node. - [X : 6, Y : 3]( NG ) : Split the response data code and transmit data again. If data cannot be determined as listed above, it is determined as output data transmitted from remote node, then the data is split, converted, and stored. ( [X : 6, Y : 4 ] goto LAB03 ) 5. Process the received output data. In the sample, the transmission data is structured as { [ RSSI(4byte) ][ Transmission source PANID(4byte) ][ Transmission source address (4byte) ][ Output data +CRLF(50byte) ]} Split this data as listed below to store them. - [X : 9, Y : 3] LSTAG10 = Le LSTAG03 (RSSI value) - [X : 9, Y : 4] LSTAG11 = Mi LSTAG03 (Transmission source PANID) - [X : 9, Y : 5] LSTAG12 = Mi LSTAG03 (Transmission source address) - [X : 9, Y : 6] LSTAG13 = Ri LSTAG03 (Output data) 6. After completing "5", convert the stored string to number, and store it in a different place. - [X : 9, Y : 7] LTAG01 = LTAG10 *‚P - [X : 10, Y : 7] TAG11 = LTAG11 - [X : 11, Y : 7] TAG12 = LTAG12 (*1) As for gRSSI valueh only, determine (RSSI value is 32768 or larger) with [X : 11, Y : 6]. - True : TAG10 = LTAG01 - 32768 - False : TAG10 = LTAG01 + 0 7D After storing the data, disconnect link-0 and return to "‚P". *It means looping "‚P" to "7". [Additional information] -The sample currently used has communication settings as follows: - Transmission destination ID 0001 - Transmission destination address 0001 - Input data TEST Refer to this information when running a communication test. - Perform link setting before starting Transmission/ Reception task. (Above tab > Settings > Link setting) - If an error (such as carrier sense error) occurs when waiting for a response to receive, an error message is output and the task goes back to the transmission state. - This sample program is designed with an intention to communicate with "LoRa Reception and Transmission". Therefore, it is recommended to download "LoRa Reception and Transmission" when running the communication test. - In addition to this "readme", reading "Reference Manual (Software) MCS341 Configurable type.docx" helps understand the task more deeply. (Sample11)