This should be the initial step before using the data logger configuration manager.
Connect the USB Port to the configuration system as shown above
Check the COM Port
Device
Manager
Ports as
shown
above
Note: Ensure that you have the FTDI Com port driver loaded. Please download and install from the link provided below if it is not installed.
Link:
https://www.ftdichip.com/Drivers/VCP.htm
For Installation Guide ,
CLICK HERE
Device can be logged in two ways for configuration: 1. Local Login and
2.Remote Login(Refer Page 58 )
1.Click on Com Port Select USB.
2.Select your Com Port and click on Open.

3.Use the Default Password “RDL123” during Login
Select the required I/O options and click on Save button.
This Setting will indicate which digital input needs to be
logged.
1.Select check box
to save the data to the SD Card and click on buttonSave
2.Select the type of Digital Input (Digital Input High/Low, 32 Bit Counter, Time Enabled Counter)
and click on Save button.
3.Select the Check box
to Enable/Disable Digital Input channel and click on Save button.
4.Click on Read to display the configuration that is already saved.
Note: Data Logged only when Input channel status changed (From High to Low or Low to High)
These Settings will configure Digital counter input.
1.Select the Checkbox
to Enable/Disable Digital Counter Input channel.
2.Set the Max Count
3.Click Save to write these count settings in the memory.
4.Click on Read to display the configuration that is already saved. will display the current max count /
channel.
Note:
1.Data Logged only when Input Channel status changed (From High to Low or Low to High).
2.Data will be pushed to the Remote Server once counter reaches to max set count (Applicable only when
counter option enabled).
3.Once counter reaches the max count then it resets to zero (Applicable only when counter option enabled).
Counting with respect to time in sec
These Settings will configure Digital counter input.
1.Select the Checkbox
to Enable/Disable Digital Counter Input channel.
2.Set the Time(sec)
3.Click Save to write these count settings in the memory.
4.Click on Read to display the configuration that is already saved. will display the current max count /
channel.

NOTE:Max load current 100mA, 35v In the case of load drawing more current you need to add the additional driver.


Digital Output:
Digital Output / PWM can controlled directly from server using MQTT Subscribe service.
Command: Digital _Channel =Logic High/ Low
Example:
1.DO1=0
Digital output (DO) 1 becomes LOW
2.DO1=1
Digital output (DO) 1 becomes HIGH
3.DO2=0
Digital output (DO) 2 becomes LOW
4.DO2=1
Digital output (DO) 2 becomes HIGH
5.DO3=0
Digital output (DO) 3 becomes LOW
6.DO3=1
Digital output (DO) 3 becomes HIGH
NOTE:Digital Output works only for 4G and 2G, it doesn’t support for WiFi Communication.


Relay can be controlled directly from server using MQTT Subscribe service.
Command: Relay = Logic High/ Low

Relay output command:
RL1=1
Relay becomes HIGH
RL1=0
Relay becomes LOW

The below given settings shows how to configure Loop current (4-20mA) and 0-10V Analog Channels.



NOTE:Don’t connect Voltage source when Channel is set for Current Source Mode.

Select the check box
for enabling the MODBUS and Click on Save button.

1.Click on MODBUS RTU from the side bar menu
2.Click on Read to know the previous stored Configuration.
3.Click on Com Port Settings
a.Select Baud Rate from the dropdown.
b.Select Data Bit from the dropdown.
c.Select Parity from the dropdown.
d.Select Stop Bit from the dropdown.
e.Click on Save button.
f.Click on Read to display the configuration that is already saved., will display the configuration that is already saved.
Based on Meter/Slave type the register polling classified in three Bank R1, R2 and R3.
R1 Register Bank meant for reading maximum 10 slave devices and maximum register length of 100 for each slave.
R2 Register Bank meant for reading maximum 32 similar slave /meters with 30 register length for each slave/meter
R3 Register Bank meant for reading maximum 10 devices with 100 register length for each slave devices and all slaves can be set for different polling time.
NOTE:Maximum 1000+ tags can be polled by combining R1, R2, and R3 Register Banks

1.Click on the check box
to enable MODBUS Register Bank R1, and click on Save button.
2.Enter MODBUS Register details as shown above
3.Enter MODBUS credential.
4.R1 Register Bank supports 10 slave devices for each slave you can configure max length up to 100 register.
5.Select Enable/Disable check box
to poll the register.
6.Click on Save button.

1.Click on the check box
to enable MODBUS Register Bank R2, and click on Save button.
2.Enter MODBUS credential as shown above.
This supports for 32 similar slaves/meters with 30 registers length for each slave/meter
3.Select Enable/Disable check box
to poll the register
4.Click on Save button.
NOTE:In R2, Address configuration is same for multiple slaves; it has only facility to change Slave ID of each device.

1.Click on the check box
to enable MODBUS Register Bank R3, and click on Save button.
2.Enter MODBUS credential as shown above.
This supports 10 slaves, for each slave 10 start registers are available and for each start register configure up to 100 lengths.
3.R3 has the facility to add polling time for each slave ID.
4.Select Enable/Disable check box
to poll the register.
5.Click on Save button.


1. Set the Device MAC Address, Data Logger IP, Subnet Mask,
Gateway and click on Save.
2. Slave ID: This is the MODBUS Slave ID. Maximum10 Slave info can be accessed.
3. Slave IP: Mention the IP Address of the Slave.
4.Socket: If the Slave IP address is same for multiple requests then the socket number will be the
same.
If the IP address is different, then the socket number is different as shown above (Ex: For Slave
ID 1 and
3 the slave IP is same (192.168.1.187) so the socket number should be the same (0)).
5.Slave Port No: Mention the Port No. (Default 502).
6.Start Address:6.This is the starting address of the slave from where data needs to be read.
7.Offset: Enter Offset of the Slave device.
8.Type: 8.Mention the register type. It could be Coil/Input Register/Holding Register.
9.Conversion:
Raw Hex: MODBUS 16 bits are extracted from slaves.
Integer: MODBUS 16 bits are extracted from slaves.
Double: MODBUS 16 bits are extracted from slaves.
Float-Big Endian: MODBUS floats are extracted from slaves
in Big Endian format.
Float-Little Endian: MODBUS 16 bits are extracted from
slaves.
64 bit UINT: MODBUS 16 bits are extracted from slaves.
10.Length: Total length will be 100,you can use length of 1-100 of 16 bit data
11.Status: T11.If check box is enabled, the slave id will be ENABLED for polling, else slave id
polling will be DISABLED.
12.Click on Savebutton to save the above configuration.
13.Click on Read to display the configuration that is already saved., to display the configuration that is
already saved
14.Select the Polling Interval sec/min/hour
Note:
1. Device and Slave should be in same network
2. Max 100 registers can be scanned.

1. Choose 4G/LTE in the Communication Media. Click on Save.
2. Select the protocol FTP and Save.
3. Provide FTP Server IP(Ex:YourServerIP/),Username(Ex:demo@YourServerIP),Password(Ex:abcdef).
4. Log Folder: Provide folder name for the FTP Server(Ex:datalogger).
5. Click on Save will save these settings in the memory.
6. APN: Provide APN for the connection.Click on Save. Ex: for BSNL it is "bsnlnet".
7. FTP Uploading Time: Select the Polling Interval sec/min/hour
8. Click on Save button to save the above configuration.
9. Click on Read to display the configuration that is already saved.
NOTE: FTP Account creating guideline document. Please go through the below given link document.
LINK1:https://github.com/researchdesignlab/Industrial-Data-Logger/blob/master/CREATING%20FTP%20ACCOUNT.pdf
YouTube Link:https://www.youtube.com/watch?v=_MfcA8Jcmtk

APN: Provide APN for the connection. Click on Save.
Ex: for BSNL 🡪 "bsnlnet".
Airtel 🡪 “airtelgprs.com”
Idea 🡪 “internet”
File uploading format for given date 15/11/2019 will be
151119:142501R.csv

File uploading format for given date 15/11/2019 will be
151119:142501T.csv

File uploading format for given date 15/11/2019 will be
151119:142501D.csv

File uploading format for given date 15/11/2019 will be
151119:142501A.csv


1. Choose 4G/LTE in the Communication Media. Click on Save.
2. Select the protocol JSON and Save.
3. Post URL: Provide Your Server URL(Ex:http://yourdomainname/yourfolder/json.php).
4. Click on Save button to save the above configuration.
5. APN: Provide APN for the connection. Click on Save
Ex: for BSNL it is "bsnlnet".
NOTE: JSON implementation guideline document. Please go through the below given link document.
LINK1:https://github.com/researchdesignlab/Industrial-Data-Logger/blob/master/CREATING%20FTP%20ACCOUNT.pdf
YouTube Link:https://www.youtube.com/watch?v=_MfcA8Jcmtk
API FORMAT:
{“Type”:”MR”,”ID”:”1235”,”DATE”:”1/11/19”,”TIME”:”12:47:9”,”SL_ID” :”1”,”Reg
Ad”:”1003”,”Length”:”6”,”D1”:”0”,”D2”:”0”,”D3”:”0”,”D4”:”0”,”D5”:”0”,”D6”:”0”}
NOTE: MODBUS RTU/TCP 16bit/32bit data parsed in hex decimal format.
API FORMAT:
{“Type”:”MT”,”ID”:”1123”,”DATE”:”4/11/19”,”TIME”:”12:21:21”,”SL_ID” :”1”,”Reg
Ad”:”1060”,”Length”:”6”,”D1”:”1165”,”D2”:”1166”,”D3”:”1167”,”D4”:”1168”,”D5”:” 1169”,”D6”:”1170”}
NOTE: MODBUS RTU/TCP 16bit/32bit data parsed in hexa decimal format
API FORMAT:
{"Type":"AN","ID":"6549","DATE":"18/08/21","TIME":"15:54:43","AC1":"0.00","AC2":"0.
00","AC3":"0.00","AC4":"0.00","AC5":"0.00","AC6":"0.00","AC7":"0.00","AC8":"0.00","A C9":"0.00","AC10":"0.00","AC11":"0.00","AC12":"0.00"}
API FORMAT:
{“Type”:”DI”,”ID”:”1234”,”DATE”:”2/11/19”,”TIME”:”12:35:15”,”DC1”:”0”,”D C2”:” 0”,”DC3”:”0”,”DC4”:”0”}

1. Choose 4G/LTE in the Communication Media. Click on Save.
2. Select the protocol MQTT and Save.
3. Broker Address: Enter your broker address of MQTT(Ex:yourbrokeraddress.cloudmqtt.com).
4. Cloud Username: Enter MQTT cloud Username(Ex:Cloudmqttusername).
5. Password: Enter MQTT cloud Password(Ex:abcdef).
6. Port: Enter Port number for MQTT cloud(Ex:15590).
7. Publish Topic: Enter Topic name to publish the data to server(Ex:Publish_Data).
8. Subscribe Topic: To receive the data from the server(Ex:Subscribe_Data)
9. Device Id/Tag: Enter the Device ID(Ex:DT1)
10. Click on Save will save these settings in the memory.
11. APN:Enter APN for the connection. Ex: for BSNL it is "bsnlnet".
12. Click on Save.
NOTE: MQTT Broker creating guideline document. Please go through the below given link document.
LINK1:https://github.com/researchdesignlab/Industrial-Data-Logger/blob/master/MQTT_Linux_Bringup_ver1.0.pdf
LINK2 https://www.cloudmqtt.com/docs/index.html
YouTube Link: https://www.youtube.com/watch?v=qNFmfBpNMsg&t=3s
Parsing Format:
{“Type”:”MR”,”ID”:”1235”,”DATE”:”1/11/19”,”TIME”:”12:47:9”,”SL_ID” :”1”,”Reg
Ad”:”1003”,”Length”:”6”,”D1”:”0”,”D2”:”0”,”D3”:”0”,”D4”:”0”,”D5”:”0”,”D6”:”0”}
NOTE: MODBUS RTU/TCP 16bit/32bit data parsed in hexadecimal format
Parsing Format:
{“Type”:”MT”,”ID”:”1123”,”DATE”:”4/11/19”,”TIME”:”12:21:21”,”SL_ID” :”1”,”Reg
Ad”:”1060”,”Length”:”6”,”D1”:”1165”,”D2”:”1166”,”D3”:”1167”,”D4”:”1168”,”D5”:”1 169”,”D6”:”1170”}
NOTE:MODBUS RTU/TCP 16bit/32bit data parsed in hexadecimal format
Parsing Format:
{"Type":"AN","ID":"6549","DATE":"18/08/21","TIME":"15:54:43","AC1":"0.00","AC2":"0.00","AC3
":"0.00","AC4":"0.00","AC5":"0.00","AC6":"0.00","AC7":"0.00","AC8":"0.00","AC9":"0.00","AC10": "0.00","AC11":"0.00","AC12":"0.00"}
NOTE:For Analog Input configuration look into the section 2.2 in this document
Parsing Format:
{“Type”:”DI”,”ID”:”1234”,”DATE”:”2/11/19”,”TIME”:”12:35:15”,”DC1”:”0”,”DC2”:” 0”,”DC3”:”0”,”DC4”:”0”}

1. Choose 4G/LTE in the Communication Media. Click on Save.
2. Select the protocol MQTT and Save.
3. Broker Address: Enter your broker address of MQTT(Ex:yourbrokeraddress.cloudmqtt.com).
4. Cloud Username: Enter MQTT cloud Username(Ex:Cloudmqttusername).
5. Password: Enter MQTT cloud Password(Ex:abcdef).
6. Port: Enter Port number for MQTT cloud(Ex:15590).
7. Publish Topic: Enter Topic name to publish the data to server(Ex:Publish_Data).
8. Subscribe Topic: To receive the data from the server(Ex:Subscribe_Data)
9. Device Id/Tag: Enter the Device ID(Ex:DT1)
10. Click on Enable SSL/TSL and set the SSL Parameters.
11. Protocol: Select in the dropdown which protocol you are using.
12. CA Certificate: Please upload the CA Certificate.
13. Click on Save button to save the above configuration.
14. Click on Delete Certificate to delete the uploaded Certificate.
15. APN: Provide APN for the connection. Ex: for BSNL ->"bsnlnet".Click on Apply.
NOTE:Make sure that power supply connected during the process of uploading the SSL certificate

1. Choose Wi-Fi in the Communication Media. Click on Save.
2. Wi-Fi Settings are enabled now.
3. Select protocol MQTT/JSON and click on Save button.
4. Wi-Fi Settings: Select DHCP. Click on Apply.
5. Access Point: Set the SSID (Ex:yourwifissid) and Password (EX:abdcdef).
6. Click on Save button to save these settings in the memory.

1. Choose Wi-Fi in the Communication Media. Click on Save.
2. Select the protocol JSON
3. Wi-Fi Settings: Select Static. Click on Apply.
4. Enter the IP, Subnet Mask, Gateway, Primary DNS, Secondary DNS and click on Save.
5. Access Point: Set the SSID (Ex:yourwifissid) and Password(Ex:abcdef), Click on Save
button.

1. Choose Wi-Fi in the Communication Media. Click on Save.
2. Wi-Fi Settings: Select the protocol JSON and Save.
3. Post URL: Provide Your Server URL.(Ex: http://yourdomainname/yourfolder/json.php)
4. Click on Save button to save the above configuration.
API FORMAT:
{“Type”:”MR”,”ID”:”1235”,”DATE”:”1/11/19”,”TIME”:”12:47:9”,”SL_ID” :”1”,”Reg
Ad”:”1003”,”Length”:”6”,”D1”:”0”,”D2”:”0”,”D3”:”0”,”D4”:”0”,”D5”:”0”,”D6”:”0”}
NOTE:MODBUS RTU/TCP 16bit/32bit data parsed in hexadecimal format
API FORMAT:
{“Type”:”MT”,”ID”:”1234”,”DATE”:”4/11/19”,”TIME”:”12:21:21”,”SL_ID” :”1”,”Reg
Ad”:”1060”,”Length”:”6”,”D1”:”1165”,”D2”:”1166”,”D3”:”1167”,”D4”:”1168”,”D5”:”1
169”,”D6”:”1170”}
NOTE:MODBUS RTU/TCP 16bit/32bit data parsed in hexadecimal format
API FORMAT:
{"Type":"AN","ID":"6549","DATE":"18/08/21","TIME":"15:54:43","AC1":"0.00","AC2":"0.00","AC3
":"0.00","AC4":"0.00","AC5":"0.00","AC6":"0.00","AC7":"0.00","AC8":"0.00","AC9":"0.00","AC10":
"0.00","AC11":"0.00","AC12":"0.00"}
API FORMAT:
{“Type”:”DI”,”ID”:”1234”,”DATE”:”2/11/19”,”TIME”:”12:35:15”,”DC1”:”0”,”DC2”:”
0”,”DC3”:”0”,”DC4”:”0”}

1. Choose Wi-Fi in the Communication Media. Click on Save.
2. Wi-Fi Settings are enabled now, ready for MQTT
3. MQTT: Data logging happens to MQTT server. Click on Save.
4. Broker Address: Provide your broker address of MQTT (Ex: yourbrokeraddress.cloudmqtt.com)
5. Cloud Username: Provide MQTT cloud Username.(Ex: Cloudmqttusername)
6. Password: Provide MQTT cloud Password.(Ex:abcdef).
7. Port: Provide Port number for MQTT cloud.(Ex:15590)
8. Topic:Provide Topic name.(Ex:Topic1)
9. Device Id/Tag: Provide the Device ID(Ex:datalogger)
10. Click on Save button to save the above configuration.
Parsing Format:
{“Type”:”MR”,”ID”:”1235”,”DATE”:”1/11/19”,”TIME”:”12:47:9”,”SL_ID” :”1”,”Reg
Ad”:”1003”,”Length”:”6”,”D1”:”0”,”D2”:”0”,”D3”:”0”,”D4”:”0”,”D5”:”0”,”D6”:”0”}
NOTE:MODBUS RTU/TCP 16bit/32bit data parsed in hexadecimal format
Parsing Format:
{“Type”:”MT”,”ID”:”1123”,”DATE”:”4/11/19”,”TIME”:”12:21:21”,”SL_ID” :”1”,”Reg
Ad”:”1060”,”Length”:”6”,”D1”:”1165”,”D2”:”1166”,”D3”:”1167”,”D4”:”1168”,”D5”:”1 169”,”D6”:”1170”}
NOTE:MODBUS RTU/TCP 16bit/32bit data parsed in hexadecimal format
Parsing Format:
{"Type":"AN","ID":"6549","DATE":"18/08/21","TIME":"15:54:43","AC1":"0.00","AC2
":"0.00","AC3":"0.00","AC4":"0.00","AC5":"0.00","AC6":"0.00","AC7":"0.00","AC8":" 0.00","AC9":"0.00","AC10":"0.00","AC11":"0.00","AC12":"0.00"}
Parsing Format:
{“Type”:“DI”,”ID”:”1234”,”DATE”:”2/11/19”,”TIME”:”12:35:15”,”DC1”:”0”,”DC2”:” 0”,”DC3”:”0”,”DC4”:”0”}
Device sends emergency alerts and different Escalation level SMS to the remote user on real time basis. Device also supports Automating the remote asset based on set threshold. Alarm can be applied for Digital, Analog and Modbus Inputs.

1. Enable Digital I/O and Click on Save button.
2. Click on Channel 1 and select Alert Settings tab and Enable it and then Save.
3. Alert Message Escalation Level, enable the Levels, set the Threshold Time, enter the contact number and write the alert message to be sent and click on Save button.
4.Maximum 5 phone numbers and maximum 25 character length alert messages can be registered.
NOTE:If digital Input is triggered then send a configured message to the configured number based on threshold time priority.

Case 1: Automate Task when Digital Input Channel 1 goes High, make the Digital Output Channel High.
To do the above task, follow the below given steps:
1.Click on Channel 1.
2.Click on Automated Task tab and enable the Digital Output and Save.
3.Select the Digital Output Channel
4.Make the bit status High/Low.
5.Click on Save button to save the above configuration.
Case 2: Automate Task when Digital Input Channel 1 goes High ,write data to slave ID 1 and register ID 10.
To do the above task, follow the below given steps:
1.Click on Channel 1.
2.Click on Automated Task tab and enable the Digital Output and Save.
3.Select the Digital Output Channel
4. Make the bit status High/Low.
5.Enable the MODBUS and Click on Save button.
6.Enter the Slave ID, Register address and Data.
7.Click on Save button to save the above configuration

1. Select MODBUS, Click on Channel 1 and select Alert Settings tab and Enable it and then Save.
2. Alert Message Escalation Level, enable the Levels, set the Threshold Time, enter the contact number and write the alert message to be sent and click on Save button.
3. Maximum 5 phone numbers and maximum 25 character length alert messages can be registered.
NOTE:MODBUS Alarm is linked to MODBUS Register Bank R3.
MODBUS Register Bank R3 set slave received value match with an alarm registered condition and value, if the condition is successful, then send a configured message to the configured number based on threshold time and escalation priority.

Case 1: Automate Task when MODBUS Channel 1 goes High, make Digital Output Channel High.
To do the above task, follow the below given steps:
1.Click on Channel 1 and select Automated Task tab and Enable it and then Save.
2.Select the Digital Output Channel
3.Make the bit status High/Low.
4.Click on Save button to save the above configuration.
Case 2: Automate Task when MODBUS Input Channel 1 goes High , write data to slave ID 1 and register ID 10.
To do the above task, follow the below given steps:
1.Click on Channel 1 and select Automated Task and Enable it and then Save
2.Select the Digital Output Channel
3.Make the bit status High/Low.
4.Enable the MODBUS and Click on Save button.
5.Enter the Slave ID, Register address and Data.
6.Click on Save button to save the above configuration

1. Click on Analog and select the Channels (A1-A12) and Click on Enable and Save.
2. Select Alert Settings tab and Enable it and then Save
3. Alert Message Escalation Level, enable the Levels, set the Threshold Time, enter the contact number and write the alert message to be sent and click on Save button.
4.Maximum 5 phone numbers and maximum 25 character length alert messages can be registered.
NOTE:Analog value, match with an alarm registered condition and value, if the condition is successful, then send a configured message to the configured number based on threshold time priority.

Case 1: Automate Task when Analog Channel 1 goes High, make Digital Output Channel High.
To do the above task, follow the below given steps:
1.Click on Channel 1 and select Automated Task tab and Enable it and then Save
2.Select the Digital Output Channel
3.Make the bit status High/Low.
4.Click on Save button to save the above configuration.
Case 2: Automate Task when Analog Input Channel 1 goes High, write data to slave ID 1 and Register ID 10.
To do the above task, follow the below given steps:
1.Click on Channel 1 and select Automated Task tab and Enable it and then Save
2.Select the Digital Output Channel
3.Make the bit status High/Low.
4.Enable the MODBUS and Click on Save button.
5.Enter the Slave ID, Register address and Data and Save it.

1.Enable: Select enable to upload the file offline/when there is no internet connectivity.
2. Select radio button to Enable/Disable offline file
3.Live: Offline data sent to a configured server after receiving an internet connection.
4.Schedule: Offline data is stored in the “jsn_bup.txt” file. That file is sent to the Configured FTP Server at configured time.
5.FTP Details: Enter the FTP Server IP (Ex:yourftpServerIP), Username
(Ex:demo@yourftpserverIP), Password(Ex:abcdefg) and the Port Number
6.Click on Save button.
7.Backup Log Folder: Enter FTP server folder name(In case of multiple folder enter folder name with path)
8.Schedule: Set the Time and Date for offline data FTP poll.
9.Offline Log Data:
Log Files: You can select the .CSV files
Download: You can select the Log files from the Dropdown and Click on Download.
Delete: You can select the Log files which you want to delete from the Dropdown and click on Delete.

1.Set the Device Id (Ex:6549) and click on Save
2.Click on Read to display the configuration that is already saved.
3.Select the Enable Debug and click on Save.

1.Set the device Current time in hour, minute and seconds.
2.Date: Select the date from the drop down menu.
3.Click on Save to save the above configuration.

1.Click on Backup to take the entire data logger configuration backup.
2.Click on Restore and select the file to restore the data logger Configuration.
3.Factory Default: Click on Factory Default to restore the factory default configuration settings.
4.Restart: Click on Restart button to restart the Data Logger.

You can change the default password by entering the New Password.
NOTE:(Before Configuring the Remote, make sure that under Local login you have selected GPRS/WIFI. (For Ex:If you want to select GPRS in Remote ,first you need to configure GPRS in Local Login. Similarly if Wifi in Remote then you need to configure WiFi in Local Login).

1.Click on Com port and Select Remote from the radio button.

2.Click on Configure
3.Select the Com Port and click on Open

1.Click on Configure and Choose WiFi or GPRS from the radio button and enter the IP address.
2.In GPRS Configuration use Public IP address. If the configuration is Wi-Fi then you can use Private or Public IP addresses.
3.Click on Save Button
4.Click on Read to display the configuration that is already saved. will display the configuration that is already saved
5.Enter the Server Interval time(Ex: 60sec) of connection.
6.Click on Save.
7.Close the Com Port which is Open
8.Click on Listen

1.Use the Default Password “RDL123” during Login
2.For next step Page 5

ATTENTION:Recommended to use Meanwell power supplies of 24V 2A

NOTE:Max load current 100mA, 35v In the case of load drawing more current you need to add the additional driver.


Digital Output:
Digital Output / PWM can controlled directly from server using MQTT Subscribe service.
Command: Digital _Channel =Logic High/ Low
Example:
1.DO1=0
Digital output (DO) 1 becomes LOW
2.DO1=1
Digital output (DO) 1 becomes HIGH
3.DO2=0
Digital output (DO) 2 becomes LOW
4.DO2=1
Digital output (DO) 2 becomes HIGH
5.DO3=0
Digital output (DO) 3 becomes LOW
6.DO3=1
Digital output (DO) 3 becomes HIGH
NOTE:Digital Output works only for 4G and 2G, it doesn’t support for WiFi Communication.


Aim:Interfacing UART with ARM LPC2148
Description:
Transmit/Receive Data using UART and display the data’s on the terminal Software.
Hardware Requirement:
ARM LPC2148 Trainer Kit , USB A to B Cable and 12V 2A Power Adapter.
#include<lpc214x.h>
#include<stdint.h>
#include "UART.h"
int main(void)
{
char receive;
UART0_init();
while(1)
{
receive = UART0_RxChar();
UART0_SendString("Received:");
UART0_TxChar(receive);
UART0_SendString("\r\n");
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:Interfacing Real Time Clock with ARM LPC2148
Description:
To transmit Date and Time using UART and display the data’s on the terminal
Software.
Hardware Requirement:
ARM LPC2148 Trainer Kit, FRC Cables, USB A to B Cable and 12V 2A Power Adapter.
#include<lpc214x.h>
#include<stdint.h>
#include<stdio.h>
#include "UART0.h"
uint8_t alarm, flag;
__irq void RTC_ISR(void)
{
if (ILR & 0x01)
{
flag = 1;
ILR = ILR | 0x01;
}
if (ILR & 0x02)
{
alarm = 1;
ILR = ILR | 0x02;
}
VICVectAddr = 0;
}
typedef struct
{
uint8_t seconds;
uint8_t minutes;
uint8_t hours;
uint8_t day_of_month;
uint8_t day_of_week;
uint16_t day_of_year;
uint8_t month;
uint16_t year;
}
RTC_Time;
void RTC_Set_Time( RTC_Time Set_Time)
{
SEC = Set_Time.seconds;
MIN = Set_Time.minutes;
HOUR = Set_Time.hours;
DOM = Set_Time.day_of_month;
DOW = Set_Time.day_of_week;
DOY = Set_Time.day_of_year;
MONTH = Set_Time.month;
YEAR = Set_Time.year;
}
void RTC_Set_Alarm_Time( RTC_Time Alarm_Time)
{
ALSEC = Alarm_Time.seconds;
ALMIN = Alarm_Time.minutes;
ALHOUR = Alarm_Time.hours;
ALDOM = Alarm_Time.day_of_month;
ALDOW = Alarm_Time.day_of_week;
ALDOY = Alarm_Time.day_of_year;
ALMON = Alarm_Time.month;
ALYEAR = Alarm_Time.year;
}
RTC_Time RTC_Get_Time(void)
{
RTC_Time time;
time.seconds = SEC;
time.minutes = MIN;
time.hours = HOUR;
time.day_of_month = DOM;
time.day_of_week = DOW;
time.day_of_year = DOY;
time.month = MONTH;
time.year = YEAR;
return time;
}
int main(void)
{
/* Setting Time + Alarm */
RTC_Time set_time, alarm_time, current_time;
char timestr[30], datestr[30];
alarm = 0;
flag = 0;
IO0DIR = 0x00000010; /* P0.4 as output pin for LED */
UART0_init();
PCONP = (PCONP | (1<<9)); /* PCRTC = 1 */
/* The RTC registers cannot be written to unless we make PCRTC = 1 */
ILR = 0x0; /* No RTC interrupts */
CCR = 0x12; /* 32.768kHz clock and Reset Clock Tick Counter */
CCR = 0x10;
CIIR = 0x00; /* No interrupts */
AMR = 0x00; /* Alarm registers not masked */
VICVectAddr0 = (unsigned) RTC_ISR;
VICVectCntl0 = 0x0000002D;
VICIntEnable = 0x00002000;
VICIntSelect = 0x00000000;
set_time.seconds = 00;
set_time.minutes = 25;
set_time.hours = 11;
set_time.day_of_month = 6;
set_time.day_of_week = 5;
set_time.day_of_year = 279;
set_time.month = 10;
set_time.year = 2017;
RTC_Set_Time(set_time);
CIIR = 0x01; /* Seconds value increment interrupt */
alarm_time.seconds = 15;
alarm_time.minutes = 25;
alarm_time.hours = 11;
alarm_time.day_of_month = 6;
alarm_time.day_of_week = 5;
alarm_time.day_of_year = 279;
alarm_time.month = 10;
alarm_time.year = 2017;
RTC_Set_Alarm_Time(alarm_time);
CCR = 0x11; /* 32.768kHz clock and clock Enable */
ILR = 0x03; /* RTC interrupts enabled */
IO0CLR = 0x00000010;
/* Set the Time and Alarm once using above code lines */
/* Once the time and alarm is set, comment out the above code lines and uncomment the code
lines for "Only RTC Read" and program the device */
/* If this is not done, the time will be set repeatedly to same value whenever the device is reset or
powered */
/* Only RTC Read */
// RTC_Time current_time;
// char timestr[30], datestr[30];
// alarm = 0;
// flag = 0;
// IO0DIR = 0x00000010; /* P0.4 as output pin for LED */
// UART0_init();
// AMR = 0x00; /* Alarm registers not masked */
// CCR = 0x10;
// VICVectAddr0 = (unsigned) RTC_ISR;
// VICVectCntl0 = 0x0000002D;
// VICIntEnable = 0x00002000;
// VICIntSelect = 0x00000000;
// CCR = 0x11; /* 32.768kHz clock and clock enable */
// ILR = 0x03; /* RTC interrupts enabled */
// IO0CLR = 0x00000010;
/* Code lines below are common for "Setting time + Alarm" as well as "Only RTC Read" */
while(1)
{
if(alarm == 1)
{
current_time = RTC_Get_Time();
sprintf(timestr,"Alarm!!!: %d:%d:%d
\r\n",current_time.hours,current_time.minutes,current_time.seconds);
UART0_SendString(timestr);
uint8_t i;
for(i=0;i<10;i++)
{
IO0SET = 0x00000010;
delay_ms(300);
IO0CLR = 0x00000010;
delay_ms(300);
}
alarm = 0;
}
if (flag == 1)
{
current_time = RTC_Get_Time();
sprintf(timestr,"Time: %d:%d:%d
",current_time.hours,current_time.minutes,current_time.seconds);
sprintf(datestr,"Date: %d/%d/%d
\r\n",current_time.day_of_month,current_time.month,current_time.year);
UART0_SendString(timestr);
UART0_SendString(datestr);
flag = 0;
}
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:To interface 4x4 Hex keypad with ARM LPC2148.
Description:
To display the pressed key on the LCD Display
Hardware Requirement:
ARM LPC2148 Trainer Kit, FRC Cables, USB A to B Cable and 12V 2A Power Adapter.
#include<lpc214x.h>
#include<stdint.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
unsigned int adc_value1,adc_value2,C;
unsigned char buf[16] = {0};
char check_key(void);
unsigned int KeyPort=0x00f00000;
#define sw1 0x00010000
#define sw2 0x00020000
#define sw3 0x00040000
#define sw4 0x00080000
void delay_ms(uint16_t j) /* Function for delay in milliseconds */
{
uint16_t x,i;
for(i=0;i<j;i++)
{
for(x=0; x<6000; x++); /* loop to generate 1 millisecond delay with Cclk = 60MHz */
}
}
void LCD_CMD(char command)
{
IO0PIN = ( (IO0PIN & 0xFF0FFFFF) | ((command & 0xF0)<<16) ); /* Upper nibble of command */
IO0SET = 0x00020000; /* EN = 1 */
IO0CLR = 0x00010000; /* RS = 0, RW = 0 */
delay_ms(5);
IO0CLR = 0x00020000; /* EN = 0, RS and RW unchanged(i.e. RS = RW = 0) */
delay_ms(5);
IO0PIN = ( (IO0PIN & 0xFF0FFFFF) | ((command & 0x0F)<<20) ); /* Lower nibble of command */
IO0SET = 0x00020000; /* EN = 1 */
IO0CLR = 0x00010000; /* RS = 0, RW = 0 */
delay_ms(5);
IO0CLR = 0x00020000; /* EN = 0, RS and RW unchanged(i.e. RS = RW = 0) */
delay_ms(5);
}
void LCD_INIT(void)
{
IO0DIR = 0x00FFFFF0; /* P0.20 to P0.23 LCD Data. P0.16,,17 as RS RW and EN */
delay_ms(20);
LCD_CMD(0x02); /* Initialize lcd in 4-bit mode */
LCD_CMD(0x28); /* 2 lines */
LCD_CMD(0x0C); /* Display on cursor off */
LCD_CMD(0x06); /* Auto increment cursor */
LCD_CMD(0x01); /* Display clear */
LCD_CMD(0x80); /* First line first position */
}
void LCD_STRING (char* msg)
{
uint8_t i=0;
while(msg[i]!=0)
{
IO0PIN = ( (IO0PIN & 0xFF0FFFFF) | ((msg[i] & 0xF0)<<16) );
IO0SET = 0x00030000; /* RS = 1, EN = 1 */
IO0CLR = 0x00000020; /* RW = 0 */
delay_ms(2);
IO0CLR = 0x00020000; /* EN = 0, RS and RW unchanged(i.e. RS = 1, RW = 0) */
delay_ms(5);
IO0PIN = ( (IO0PIN & 0xFF0FFFFF) | ((msg[i] & 0x0F)<<20) );
IO0SET = 0x00030000; /* RS = 1, EN = 1 */
IO0CLR = 0x00000020; /* RW = 0 */
delay_ms(2);
IO0CLR = 0x00020000; /* EN = 0, RS and RW unchanged(i.e. RS = 1, RW = 0) */
delay_ms(5);
i++;
}
}
void LCD_CHAR (char msg)
{
IO0PIN = ( (IO0PIN & 0xFF0FFFFF) | ((msg & 0xF0)<<16) );
IO0SET = 0x00030000; /* RS = 1, EN = 1 */
IO0CLR = 0x00000020; /* RW = 0 */
delay_ms(2);
IO0CLR = 0x00020000; /* EN = 0, RS and RW unchanged(i.e. RS = 1, RW = 0) */
delay_ms(5);
IO0PIN = ( (IO0PIN & 0xFF0FFFFF) | ((msg & 0x0F)<<20) );
IO0SET = 0x00030000; /* RS = 1, EN = 1 */
IO0CLR = 0x00000020; /* RW = 0 */
delay_ms(2);
IO0CLR = 0x00020000; /* EN = 0, RS and RW unchanged(i.e. RS = 1, RW = 0) */
delay_ms(5);
}
int main(void)
{
IODIR1=KeyPort;
LCD_INIT();
LCD_STRING("--- RDL---");
LCD_CMD(0xC0);
while(1)
{
delay_ms(5);
LCD_CHAR(check_key());
}
}
// IODIR0=0X0007ffCF0;
char check_key(void)
{
while(1)
{
//
IOSET1=0x00EF0000;
delay_ms(5);
if((IOPIN1&sw1)==0)
{
C='1';
while((IOPIN1&sw1)==0);
return(C);
}
if((IOPIN1&sw2)==0)
{
C='5';
while((IOPIN1&sw2)==0);
return(C);
}
if((IOPIN1&sw3)==0) {
C='9';
while((IOPIN1&sw3)==0);
return(C); }
if((IOPIN1&sw4)==0) {
C='C';
while((IOPIN1&sw4)==0);
return(C); }
IOCLR1=0x00EF0000;
delay_ms(5);
IOSET1=0x00DF0000;
delay_ms(5);
if((IOPIN1&sw1)==0) {
C='2';
while((IOPIN1&sw1)==0);
return(C); }
if((IOPIN1&sw2)==0) {
C='6';
while((IOPIN1&sw2)==0);
return(C); }
if((IOPIN1&sw3)==0) {
C='0';
while((IOPIN1&sw3)==0);
return(C); }
if((IOPIN1&sw4)==0) {
C='D';
while((IOPIN1&sw4)==0);
return(C);
}
IOCLR1=0x00DF0000;
delay_ms(5);
IOSET1=0x00BF0000;
delay_ms(5);
if((IOPIN1&sw1)==0) {
C='3';
while((IOPIN1&sw1)==0);
return(C); }
if((IOPIN1&sw2)==0) {
C='7';
while((IOPIN1&sw2)==0);
return(C); }
if((IOPIN1&sw3)==0) {
C='A';
while((IOPIN1&sw3)==0);
return(C); }
if((IOPIN1&sw4)==0) {
C='E';
while((IOPIN1&sw4)==0);
return(C); }
IOCLR1=0x00BF0000;
delay_ms(5);
IOSET1=0x007F0000;
delay_ms(5);
if((IOPIN1&sw1)==0) {
C='4';
while((IOPIN1&sw1)==0);
return(C); }
if((IOPIN1&sw2)==0) {
C='8';
while((IOPIN1&sw2)==0);
return(C);
}
if((IOPIN1&sw3)==0)
{
C='B';
while((IOPIN1&sw3)==0);
return(C);
}
if((IOPIN1&sw4)==0)
{
C='F';
while((IOPIN1&sw4)==0);
return(C);
}
IOCLR1=0x007F0000;
delay_ms(5);
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:To interface Stepper Motor with ARM LPC2148
Description:
To rotate Stepper Motor using ARM LPC2148.
Hardware Requirement:
ARM LPC2148 Trainer Kit, Stepper Motor, FRC Cables, USB A to B Cable and 12V 2A Power Adapter.
#include<LPC21xx.h>
void _delay_ms(int j)
{
int x,l;
for(l=0;l<j;l++)
{
for(x=0; x<6000; x++); /* loop to generate 1 milisecond delay with Cclk = 60MHz */
}
}
int main()
{
int i=0;
PINSEL0=0x00000000; //select pins for blinking led
IODIR0=0x00ff0000; //select I/O pins as output
while(1)
{
for(i=0;i<100;i++)
{
IOSET0 = 0x00EC0000;
_delay_ms(4);
IOCLR0 = 0x00EC0000;
IOSET0 = 0x00DC0000;
_delay_ms(4);
IOCLR0=0x00DC0000;
IOSET0 = 0x00BC0000;
_delay_ms(4);
IOCLR0=0x00BC0000;
IOSET0 = 0x007C0000;
_delay_ms(4);
IOCLR0=0x007C0000;
}
for(i=0;i<100;i++)
{
IOSET0 = 0x007C0000;
_delay_ms(4);
IOCLR0=0x007C0000;
IOSET0 = 0x00BC0000;
_delay_ms(4);
IOCLR0=0x00BC0000;
IOSET0 = 0x00DC0000;
_delay_ms(4);
IOCLR0=0x00DC0000;
IOSET0 = 0x00EC0000;
_delay_ms(4);
IOCLR0=0x00EC0000;
}
}
}
/* Delay routine;gives an approximate delay in milliseconds */
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:To interface PWM with ARM LPC2148.
Description:
To control the Brightness of the LED through PWM using ARM LPC2148.
Hardware Requirement:
ARM LPC2148 Trainer Kit, FRC Cables, USB A to B Cable and 12V 2A Power Adapter
#include <lpc214x.h>
#define PLOCK 0x00000400
#define PWMPRESCALE 60 //60 PCLK cycles to increment TC by 1 i.e 1 Micro-second
void initPWM(void);
void initClocks(void);
void setupPLL0(void);
void feedSeq(void);
void connectPLL0(void);
void delay_ms(int j) /* Function for delay in milliseconds */
{
int x,i;
for(i=0;i<j;i++)
{
for(x=0; x<6000; x++); /* loop to generate 1 millisecond delay with Cclk = 60MHz */
}
}
int DUTY=0;
int main(void)
{
initClocks(); //Initialize CPU and Peripheral Clocks @ 60Mhz
initPWM(); //Initialize PWM
//IO0DIR = 0x1; This is not needed!
//Also by default all pins are configured as Inputs after MCU Reset.
IO0DIR = 0x01;
while(1)
{
for(DUTY=0;DUTY<10000;DUTY++)
{
PWMMR1 = DUTY; //25% Bright
PWMLER = (1<<1);
delay_ms(1);
}
/* if( ((IO0PIN) & (1<<2)) ) // Check P0.2
{
PWMMR1 = 2500; //25% Bright
PWMLER = (1<<1);
}
else if( ((IO0PIN) & (1<<3)) ) // Check P0.3
{
PWMMR1 = 5000; //50% Bright
PWMLER = (1<<1);
}
else if( ((IO0PIN) & (1<<4)) ) // Check P0.4
{
PWMMR1 = 7500; //75% Bright
PWMLER = (1<<1);
}
else if( ((IO0PIN) & (1<<5)) ) // Check P0.5
{
PWMMR1 = 10000; //T-ON=100% , Hence 25% Bright
PWMLER = (1<<1); //Update Latch Enable bit for PWMMR1
} */
}
//return 0; //normally this wont execute ever
}
void initPWM(void)
{
/*Assuming that PLL0 has been setup with CCLK = 60Mhz and PCLK also = 60Mhz.*/
/*This is a per the Setup & Init Sequence given in the tutorial*/
PINSEL0 = 0x00000002; //SELECT PIN Select 0 FOR PWM1(P0.0)
//PINSEL0 = (1<<1); // Select PWM1 output for Pin0.0
PWMPCR = 0x0; //Select Single Edge PWM - by default its single Edged so this line can be removed
PWMPR = PWMPRESCALE-1; // 1 micro-second resolution
PWMMR0 = 10000; // 10ms period duration
PWMMR1 = 2500; // 2.5ms - pulse duration i.e width (Brigtness level)
PWMMCR = (1<<1); // Reset PWMTC on PWMMR0 match
PWMLER = (1<<1) | (1<<0); // update MR0 and MR1
PWMPCR = (1<<9); // enable PWM output
PWMTCR = (1<<1) ; //Reset PWM TC & PR
//Now , the final moment - enable everything
PWMTCR = (1<<0) | (1<<3); // enable counters and PWM Mode
//PWM Generation goes active now
//Now you can get the PWM output at Pin P0.0!
}
void initClocks(void)
{
setupPLL0();
feedSeq(); //sequence for locking PLL to desired freq.
connectPLL0();
feedSeq(); //sequence for connecting the PLL as system clock
//SysClock is now ticking @ 60Mhz!
VPBDIV = 0x01; // PCLK is same as CCLK i.e 60Mhz
//PLL0 Now configured!
}
//---------PLL Related Functions :---------------
void setupPLL0(void)
{
//Note : Assuming 12Mhz Xtal is connected to LPC2148.
PLL0CON = 0x01; // PPLE=1 & PPLC=0 so it will be enabled
// but not connected after FEED sequence
PLL0CFG = 0x24; // set the multipler to 5 (i.e actually 4)
// i.e 12x5 = 60 Mhz (M - 1 = 4)!!!
// Set P=2 since we want FCCO in range!!!
// So , Assign PSEL =01 in PLL0CFG as per the table.
}
void feedSeq(void)
{
PLL0FEED = 0xAA;
PLL0FEED = 0x55;
}
void connectPLL0(void)
{
// check whether PLL has locked on to the desired freq by reading the lock bit
// in the PPL0STAT register
while( !( PLL0STAT & PLOCK ));
// now enable(again) and connect
PLL0CON = 0x03;
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:To interface EEPROM with ARM LPC2148.
Description:
Transmit EEPROM Data using UART and display the data’s on the terminal Software.
Hardware Requirement:
ARM LPC2148 Trainer Kit, FRC Cables, USB A to B Cable and 12V 2A Power Adapter
#include <LPC214x.h>
void I2C_init(void);
void byte_write(unsigned char address, unsigned char location, unsigned char data);
void send_start(void);
void send_stop(void);
unsigned char byte_read(unsigned char address,unsigned char location);
void msdelay(unsigned int time);
void uart0Init(void)
{
// port 0 tx P0.1 and rx P0.0 selected
U0LCR=0x83; //8bit data, no parity, 1 stop bit
U0DLL=97;// 9600 baud rate @15Mhz Pclk
U0LCR=0x03;// DLAB=0
}
void uart0Putch(unsigned char ch)
{
U0THR=ch; // Transmitter holding register
while(!(U0LSR & 0x20));// wait still THR=0
}
void UART0_Txstring(unsigned char *Str)
{
int i=0;
while(Str[i]!='\0')
{
uart0Putch(Str[i]);
i++;
}
}
int main()
{
int i;
unsigned char read_data;
unsigned char
write_data[10]="KANWAL";//{0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A};
PINSEL0=0x00000055;
PINSEL1=0x00000000;
PINSEL2=0x00000000;
uart0Init();
I2C_init();
// LCD_writestring("Writing from I2C");
UART0_Txstring("Writing from I2C");
for(i=0;i<10;i++)
{
byte_write(0xA0,i,write_data[i]);
uart0Putch(write_data[i]);
msdelay(100);
}
// LCD_cmd(0xC0);
uart0Putch(0x0d);
UART0_Txstring("reading from I2C : ");
for(i=0;i<6;i++)
{
read_data=byte_read(0xA0,i);
uart0Putch(read_data);
// LCD_data(read_data);
}
}
void I2C_init(void)
{
I2C0CONCLR=0xFF;
I2C0CONSET=0x40; //enable I2C
I2C0SCLH=75; //0x4B
I2C0SCLL=75; //0x4B
}
void byte_write(unsigned char address, unsigned char location, unsigned char data)
{
I2C0CONCLR=0xFF;
I2C0CONSET=0x40;
send_start(); //send start condition
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start
I2C0DAT=address&0xFE; //selecting address in
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start
I2C0DAT=location; //sending memory location
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start
I2C0DAT=data;
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start flag
send_stop(); //send stop bit
}
void send_start()
{
I2C0CONSET=0x20;
}
void send_stop()
{
I2C0CONSET=0x10;
}
unsigned char byte_read(unsigned char address,unsigned char location)
{
unsigned char data;
I2C0CONCLR=0xFF;
I2C0CONSET=0x40;
send_start();
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start
I2C0DAT=address&0xFE; //selecting address in
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start
I2C0DAT=location; //sending memory location
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28; //clear SI flag and start
send_start(); //repeated start
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28;
I2C0DAT=address|0x01;
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28;
I2C0CONCLR=0x04; //NACK
while(!(I2C0CONSET&0x08)); //check SI flag
I2C0CONCLR=0x28;
data=I2C0DAT;
send_stop();
return data;
}
void msdelay(unsigned int time)
{
int i,j;
for(i=0;i<time;i++)
{
for(j=0;j<1008;j++)
{
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:To do arithmetic operations with ARM LPC2148.
Description:
Send Arithmetic operator and numbers in tera term and its result will be displayed
in teraterm.
Hardware Requirement:
ARM LPC2148 Trainer Kit, RS232 cable, USB A to B Cable and 12V 2A Power Adapter.
In main.c
#include <stdio.h> /* prototype declarations for I/O functions */
#include <LPC214x.H> /* LPC21xx definitions */
#include "Serial.h"
#define UART0_TEXT "\n\r RDL TECHNOLOGIES PVT LTD ... Arithmetic Operations"
void delay(int count)
{
int j=0,i=0;
for(j=0;j<count;j++)
{
/* At 60Mhz, the below loop introduces
delay of 10 us */
for(i=0;i<35;i++);
}
}
/* Function to convert a string to an integer */
int atoi(char *str) {
int num = 0;
while (*str) {
num = num * 10 + (*str - '0');
str++;
}
return num;
}
/* Function to perform arithmetic operations */
void perform_operation(char operation, int num1, int num2)
{
int result;
char buffer[100];
switch(operation) {
case '+':
result = num1 + num2;
sprintf(buffer, "Result: %d + %d = %d\n\r", num1, num2, result);
break;
case '-':
result = num1 - num2;
sprintf(buffer, "Result: %d - %d = %d\n\r", num1, num2, result);
break;
case '*':
result = num1 * num2;
sprintf(buffer, "Result: %d * %d = %d\n\r", num1, num2, result);
break;
case '/':
if (num2 != 0) {
result = num1 / num2;
sprintf(buffer, "Result: %d / %d = %d\n\r", num1, num2, result);
} else {
sprintf(buffer, "Error: Division by zero\n\r");
}
break;
default:
sprintf(buffer, "Error: Invalid operation\n\r");
break;
}
uart0_puts(buffer);
}
/* Function to read a string from UART */
void uart0_gets(char *buf, int max_len) {
int i = 0;
char ch;
while (i < max_len - 1) {
ch = uart0_getkey(); // Get character from UART
if (ch == '\n' || ch == '\r') {
buf[i] = '\0';
return;
}
buf[i++] = ch;
}
buf[i] = '\0'; // Null-terminate the string
}
int main (void) { /* execution starts here */
char operation;
char num1_str[20], num2_str[20];
int num1, num2;
uart0_init(); // Initialize UART0
while (1) { /* An embedded program does not stop */
uart0_puts(UART0_TEXT);
uart0_puts("\n\rEnter operation (+, -, *, /): ");
operation = uart0_getkey(); // Get operation input
uart0_puts("\n\rEnter first number: ");
uart0_gets(num1_str, sizeof(num1_str)); // Get first number input
num1 = atoi(num1_str); // Convert string to integer
uart0_puts("\n\rEnter second number: ");
uart0_gets(num2_str, sizeof(num2_str)); // Get second number input
num2 = atoi(num2_str); // Convert string to integer
perform_operation(operation, num1, num2); // Perform arithmetic operation
delay(100000); // Delay
}
}
In Serial.c
#include /* LPC21xx definitions */
#include "Serial.h"
#define CR 0x0D
/* implementation of putchar (also used by printf function to output data) */
int sendchar (int ch) { /* Write character to Serial Port */
if (ch == '\n') {
while (!(U1LSR & 0x20));
U1THR = CR; /* output CR */
}
while (!(U1LSR & 0x20));
return (U1THR = ch);
}
int uart0_getkey (void) { /* Read character from Serial Port */
while (!(U0LSR & 0x01));
return (U0RBR);
}
int uart1_getkey (void) { /* Read character from Serial Port */
while (!(U1LSR & 0x01));
return (U1RBR);
}
void uart1_init()
{
/* initialize the serial interface */
PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */
U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
U1DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */
U1LCR = 0x03; /* DLAB = 0 */
}
void uart1_putc(char c)
{
while(!(U1LSR & 0x20)); // Wait until UART1 ready to send character
U1THR = c; // Send character
}
void uart1_puts(char *p)
{
while(*p) // Point to character
{
uart1_putc(*p++); // Send character then point to next character
}
}
void uart0_init()
{
/* initialize the serial interface */
PINSEL0 = 0x00000005; /* Enable RxD0 and TxD0 */
U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
U0DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */
U0LCR = 0x03; /* DLAB = 0 */
}
void uart0_putc(char c)
{
while(!(U0LSR & 0x20)); // Wait until UART0 ready to send character
U0THR = c; // Send character
}
void uart0_puts(char *p)
{
while(*p) // Point to character
{
uart0_putc(*p++); // Send character then point to next character
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
Aim:To do logical operations with ARM LPC2148.
Description:
Send logical operator and numbers in tera term and its result will be displayed in
teraterm
Hardware Requirement:
ARM LPC2148 Trainer Kit, RS232 cable, USB A to B Cable and 12V 2A Power Adapter.
In main.c
#include <stdio.h>/* prototype declarations for I/O functions */
#include <LPC214x.H> /* LPC21xx definitions */
#include "Serial.h"
#define UART0_TEXT "\n\r RDL TECHNOLOGIES PVT LTD ... Logical Operations"
void delay(int count)
{
int j=0,i=0;
for(j=0;j<count;j++)
{
/* At 60Mhz, the below loop introduces
delay of 10 us */
for(i=0;i<35;i++);
}
}
/* Function to convert a string to an integer */
int atoi(char *str) {
int num = 0;
while (*str) {
num = num * 10 + (*str - '0');
str++;
}
return num;
}
/* Function to perform logical operations */
void perform_operation(char operation, int num1, int num2)
{
int result;
char buffer[100];
switch(operation) {
case '&': // AND
result = num1 & num2;
sprintf(buffer, "Result: %d & %d = %d\n\r", num1, num2, result);
break;
case '|': // OR
result = num1 | num2;
sprintf(buffer, "Result: %d | %d = %d\n\r", num1, num2, result);
break;
case '~': // NOT (only for num1)
result = ~num1;
sprintf(buffer, "Result: ~%d = %d\n\r", num1, result);
break;
case 'n': // NAND
result = ~(num1 & num2);
sprintf(buffer, "Result: ~( %d & %d ) = %d\n\r", num1, num2, result);
break;
case 'o': // NOR
result = ~(num1 | num2);
sprintf(buffer, "Result: ~( %d | %d ) = %d\n\r", num1, num2, result);
break;
default:
sprintf(buffer, "Error: Invalid operation\n\r");
break;
}
uart0_puts(buffer);
}
/* Function to read a string from UART */
void uart0_gets(char *buf, int max_len) {
int i = 0;
char ch;
while (i < max_len - 1) {
ch = uart0_getkey(); // Get character from UART
if (ch == '\n' || ch == '\r') {
buf[i] = '\0';
return;
}
buf[i++] = ch;
}
buf[i] = '\0'; // Null-terminate the string
}
int main (void) { /* execution starts here */
char operation;
char num1_str[20], num2_str[20];
int num1, num2;
uart0_init(); // Initialize UART0
while (1) { /* An embedded program does not stop */
uart0_puts(UART0_TEXT);
uart0_puts("\n\rEnter operation (& (AND), | (OR), ~ (NOT), n (NAND), o (NOR)): ");
operation = uart0_getkey(); // Get operation input
uart0_puts("\n\rEnter first number: ");
uart0_gets(num1_str, sizeof(num1_str)); // Get first number input
num1 = atoi(num1_str); // Convert string to integer
if (operation != '~') { // NOT operation requires only one operand
uart0_puts("\n\rEnter second number: ");
uart0_gets(num2_str, sizeof(num2_str)); // Get second number input
num2 = atoi(num2_str); // Convert string to integer
} else {
num2 = 0; // No second operand for NOT operation
}
perform_operation(operation, num1, num2); // Perform logical operation
delay(100000); // Delay
}
}
In Serial.c
#include /* LPC21xx definitions */
#include "Serial.h"
#define CR 0x0D
/* implementation of putchar (also used by printf function to output data) */
int sendchar (int ch) { /* Write character to Serial Port */
if (ch == '\n') {
while (!(U1LSR & 0x20));
U1THR = CR; /* output CR */
}
while (!(U1LSR & 0x20));
return (U1THR = ch);
}
int uart0_getkey (void) { /* Read character from Serial Port */
while (!(U0LSR & 0x01));
return (U0RBR);
}
int uart1_getkey (void) { /* Read character from Serial Port */
while (!(U1LSR & 0x01));
return (U1RBR);
}
void uart1_init()
{
/* initialize the serial interface */
PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */
U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
U1DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */
U1LCR = 0x03; /* DLAB = 0 */
}
void uart1_putc(char c)
{
while(!(U1LSR & 0x20)); // Wait until UART1 ready to send character
U1THR = c; // Send character
}
void uart1_puts(char *p)
{
while(*p) // Point to character
{
uart1_putc(*p++); // Send character then point to next character
}
}
void uart0_init()
{
/* initialize the serial interface */
PINSEL0 = 0x00000005; /* Enable RxD0 and TxD0 */
U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
U0DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */
U0LCR = 0x03; /* DLAB = 0 */
}
void uart0_putc(char c)
{
while(!(U0LSR & 0x20)); // Wait until UART0 ready to send character
U0THR = c; // Send character
}
void uart0_puts(char *p)
{
while(*p) // Point to character
{
uart0_putc(*p++); // Send character then point to next character
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
• This code sets up an Cloud PLC to control two relays via
Bluetooth.
• It initializes the relays as outputs and starts Bluetooth communication with a device name "CPL_Relays."
• In the loop function, it listens for incoming Bluetooth commands to control the relays: "ON1" and "OFF1"
for Relay 1, and "ON2" and
"OFF2" for Relay 2. It also provides feedback over Bluetooth and prints received commands for debugging.
#include <BluetoothSerial.h>
// Define the relay pins
#define RELAY1_PIN 15
#define RELAY2_PIN 13
// Create a BluetoothSerial object
BluetoothSerial SerialBT;
void setup()
{
// Initialize serial communication for debugging
Serial.begin(115200);
// Initialize the relay pins as outputs
pinMode(RELAY1_PIN, OUTPUT);
pinMode(RELAY2_PIN, OUTPUT);
// Set the relays to be off initially
digitalWrite(RELAY1_PIN, LOW);
digitalWrite(RELAY2_PIN, LOW);
// Begin serial communication over Bluetooth
SerialBT.begin("CPL_Relays"); // Bluetooth device name
Serial.println("Bluetooth device started, you can now pair it with Bluetooth!");
}
void loop()
{
// Check if data is available on the Bluetooth serial
if (SerialBT.available())
{
// Read the incoming string
String request = SerialBT.readStringUntil('\n');
// Print the received string to the Serial Monitor (for debugging)
Serial.print("Received: ");
Serial.println(request);
// Control the relays based on the received command
if (request.indexOf("ON1") != -1)
{
digitalWrite(RELAY1_PIN, HIGH); // Turn Relay 1 on
SerialBT.println("Relay 1 turned ON");
}
else if (request.indexOf("OFF1") != -1)
{
digitalWrite(RELAY1_PIN, LOW); // Turn Relay 1 off
SerialBT.println("Relay 1 turned OFF");
}
else if (request.indexOf("ON2") != -1)
{
digitalWrite(RELAY2_PIN, HIGH); // Turn Relay 2 on
SerialBT.println("Relay 2 turned ON");
}
else if (request.indexOf("OFF2") != -1)
{
digitalWrite(RELAY2_PIN, LOW); // Turn Relay 2 off
SerialBT.println("Relay 2 turned OFF");
}
else
{
SerialBT.println("Invalid command");
}
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.
• This program sets up a web server using a Cloud PLC to control
two relays through a web interface.
• In the setup function, it initializes serial communication, connects to Wi-Fi, and starts the web
server.
• The loop function listens for incoming HTTP requests, parses them to control the relays based on the URL
path, and serves a simple HTML
page to control the relays.
• It updates the relay states and serves the appropriate HTML based on user interactions with the web
page.

#include <Cloud_PLC.h>
WiFiServer server(80); // Set web server port number to 80
String header; // Variable to store the HTTP request
const int relayPin1 = 15; // Relay pins
const int relayPin2 = 13; // Relay pins
String relayState1 = "OFF"; // Current state of the relays
String relayState2 = "OFF";
void setup()
{
Serial.begin(115200);
pinMode(relayPin1, OUTPUT); // Initialize the relay pins as outputs
pinMode(relayPin2, OUTPUT);
digitalWrite(relayPin1, LOW);
digitalWrite(relayPin2, LOW);
Cloud_PLC_Config_WIFI("TEST", "12345678"); // Connect to Wi-Fi network
server.begin(); // Start the server
}
void loop()
{
WiFiClient client = server.available(); // Listen for incoming clients
if (client)
{ // If a new client connects,
Serial.println("New Client."); // Print a message out in the serial port
String currentLine = ""; // Make a String to hold incoming data from the client
while (client.connected())
{ // Loop while the client's connected
if (client.available())
{ // If there's bytes to read from the client,
char c = client.read(); // Read a byte, then
Serial.write(c); // Print it out the serial monitor
header += c;
if (c == '\n')
{ // If the byte is a newline character
if (currentLine.length() == 0)
{ // If the current line is blank, you got two newline characters in a row.
// That's the end of the client HTTP request, so send a response:
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println("Connection: close");
client.println();
// Display the HTML web page
client.println("<!DOCTYPE html><html>");
client.println("<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
client.println("<link rel=\"icon\" href=\"data:,\">");
client.println("<style>body { text-align: center; font-family: Arial; } .button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } .button2 {background-color: #ff0000;}</style></head>");
client.println("<body><h1>Cloud PLC Relay Control</h1>");
client.println("<p>Relay 1 - State " + relayState1 + "</p>");
if (relayState1 == "OFF")
{
client.println("<p><a href=\"/relay1/on\"><button class=\"button\">ON</button></a></p>");
} else
{
client.println("<p><a href=\"/relay1/off\"><button class=\"button button2\">OFF</button></a></p>");
}
client.println("<p>Relay 2 - State " + relayState2 + "</p>");
if (relayState2 == "OFF")
{
client.println("<p><a href=\"/relay2/on\"><button class=\"button\">ON</button></a></p>");
} else
{
client.println("<p><a href=\"/relay2/off\"><button class=\"button button2\">OFF</button></a></p>");
}
client.println("</body></html>");
client.println(); // The HTTP response ends with another blank line
break; // Break out of the while loop
}
else
{ // If you got a newline, then clear currentLine
currentLine = "";
}
}
else if (c != '\r')
{ // If you got anything else but a carriage return character,
currentLine += c; // Add it to the end of the currentLine
}
// Check if the client request is to turn relay 1 on or off
if (header.indexOf("GET /relay1/on") >= 0)
{
relayState1 = "ON";
digitalWrite(relayPin1, HIGH);
} else if (header.indexOf("GET /relay1/off") >= 0)
{
relayState1 = "OFF";
digitalWrite(relayPin1, LOW);
}
// Check if the client request is to turn relay 2 on or off
if (header.indexOf("GET /relay2/on") >= 0)
{
relayState2 = "ON";
digitalWrite(relayPin2, HIGH);
} else if (header.indexOf("GET /relay2/off") >= 0)
{
relayState2 = "OFF";
digitalWrite(relayPin2, LOW);
}
}
}
// Clear the header variable
header = "";
client.stop(); // Close the connection
Serial.println("Client disconnected.");
Serial.println("");
}
}
Libraries, User Manuals and Installation guides look into the
download section.
Install
the Cloud PLC libraries(cloudplc.h) before getting start with coding. Download
Above
download link, you will find all the IO functionalities included in the Cloud PLC library.
In the
Arduino IDE, go to the Boards Manager, select the ESP32 board, and ensure that you have selected the board
version is 1.0.4.