USER MANUAL – Z-TWS4/Z-PASS2-S/S6001-RTU
207
printf (" /offset= Memory offset\n");
return 0;
}
if (strncmp (argv[i], "/name=", 6) == 0)
{
strcpy (szName, (argv[i] + 6)) ;
}
else if (strncmp (argv[i], "/size=", 6) == 0)
{
wSize = atoi (argv[i] + 6);
}
else if (strncmp (argv[i], "/offset=", 8) == 0)
{
wOffset = atoi (argv[i] + 8);
}
}
shmid = shm_open(szName, O_RDWR, S_IRWXO|S_IRWXG|S_IRWXU) ;
if (shmid < 0L)
{
printf("Error shm_open : <%s>\n", szName) ;
return 0;
}
ftruncate(shmid, wSize) ;
pMap = mmap(NULL, wSize, PROT_READ | PROT_WRITE, MAP_SHARED, shmid, 0);
if (pMap == MAP_FAILED)
{
printf("Error mmap : <%s> size <%d>\n", szName, wSize) ;
return 0;
}
sem = sem_open(szName, O_RDWR, S_IRUSR | S_IWUSR, 0);
if (sem == SEM_FAILED)
{
printf("Error sem_open : <%s>\n", szName) ;
return 0;
}
init_keyboard() ;
iCpt = 0 ;
while(_ShouldTerminate()==0)
{
sem_wait(sem) ;
printf("Iteration %d\n", iCpt++) ;
for (i=0+wOffset ; i<wSize ; i++)
{
printf ("%02X ", (unsigned char)pMap[i]);
if ((i+1)%16 == 0)
printf("\n") ;
}
sem_post(sem);
usleep(100*1000) ;
system("clear") ;
}
close_keyboard() ;
munmap(pMap, wSize);
sem_close(sem);
close (shmid) ;
return 0;
}
Содержание S6001-RTU
Страница 35: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 35 Then import the Library menu Tools Import...
Страница 68: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 68...
Страница 76: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 76...
Страница 86: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 86...
Страница 87: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 87...
Страница 107: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 107 Once the upload is successfully completed the following page is shown...
Страница 121: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 121...
Страница 127: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 127 When the procedure is completed the following page is shown...
Страница 133: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 133...
Страница 158: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 158 Select the mbus_vars csv file and click save The variables are imported...
Страница 160: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 160 Now create the Embedded Shared Memory Insert a Master Port...
Страница 162: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 162 Select the mbus_shm csv file...
Страница 165: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 165...