-------------------------------------------- CONPROSYS Script 100 No.022 -------------------------------------------- Process name: LoRa Reception and Transmission routine Date of creation: March. 12, 2018 Processing contents: Receive data that is transmitted by LoRa Transmission and Reception. After receiving, transmit data to the transmission source. [Signals] None [Operation] 1. Wait until CR code comes from link-0 while linking the reception data. 2. 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 ) 3. 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) 4DAfter completing "3", 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 "RSSI value" only, determine (RSSI value is 32768 or larger) with [X : 11, Y : 6]. - True : TAG10 = LTAG01 - 32768 - False : TAG10 = LTAG01 + 0 5. 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 6. Transmit the created data (LSTAG00) to link-0. 7. After storing the data, disconnect link-0 and return to "1". * It means looping "1" to "7". [Additional information] - The sample currently used has communication settings as follows: - Transmission destination ID 0001 - Transmission destination address 0000 - Input data RECEIVED Refer to this information when running a communication test. - Perform link setting before starting Reception/ Transmission task. (Above tab > Settings > Link setting) - If an error (such as carrier sense error) occurs when transmitting data, an error message is output and the task goes back to the reception state. - This sample program is designed with an intention to communicate with "LoRa Transmission Reception". Therefore, it is recommended to download "LoRa Transmission Reception" 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)