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;
}
Summary of Contents for S6001-RTU
Page 35: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 35 Then import the Library menu Tools Import...
Page 68: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 68...
Page 76: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 76...
Page 86: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 86...
Page 87: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 87...
Page 121: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 121...
Page 133: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 133...
Page 162: ...USER MANUAL Z TWS4 Z PASS2 S S6001 RTU 162 Select the mbus_shm csv file...