EasyManua.ls Logo

Siemens SIMATIC IOT - Page 83

Siemens SIMATIC IOT
133 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Maintaining and repairing the device
6.6 Configure IOT2050 SM
SIMATIC IOT2050
Operating Instructions, 03/2024, A5E39456816-AF
83
return 0;
}
ssize_t ret = 0;
for (int i = 0; i < 3; i++) {
int dq_value = i & 0x01;
/* Convert dq value to string */
snprintf(tmp, TMP_SIZE, "%d", dq_value);
/* Output value in string format to dq0 */
ret = write(dq0, tmp, strlen(tmp));
if (ret < 0) {
printf("Write failed, %d\r\n", ret);
break;
}
printf("Set dq0 to %s\r\n", dq_value);
/* Note that when reading a file node multiple times,
the offset must be set to 0 before the next read */
lseek(di0, 0, SEEK_SET);
memset(tmp, 0, TMP_SIZE);
/* Read value from di0 */
ret = read(di0, tmp, TMP_SIZE);
if (ret < 0) {
printf("Read di0 value failed, %d\r\n", ret);
break;
}
printf("Get di0 value: %s\r\n", tmp);
/* Convert di0 string value to integer */
int di_value = strtol(tmp, NULL, 10);
if (di_value != dq_value) {

Table of Contents

Other manuals for Siemens SIMATIC IOT

Related product manuals