Mitsubishi Electric Q81BD-J61BT11 User Manual page 87

Network interface board melsec cc-link system master/local interface board
Table of Contents

Advertisement

4 FUNCTIONS
void
Change_StanbyMaster()
{
short
short
unsigned short
short
short
short
unsigned short
//Turn on SB1 (switching request)
StNo = 0xFF;
DevType = 5;
DevNo = 0x1;
ret = mdDevSet(path,StNo,DevType,DevNo);
if(ret!=0)
}
for(Counter = 0;Counter < 100;Counter++){
//Read SB (equivalent to special SM) 43)
}
// Confirm the time-out
if(Counter>=100){
printf("[SB43]ON conformation timed out \n");
4 - 33
(5) Program example when the standby master function is used
The following shows a program example when the standby master function is
used.
Counter;
StNo;
DevType;
DevNo;
Size;
RecvBuf[10];
ret;
//Set the station number
//Set the device type (SB: equivalent to special M)
//Set the device number
{
printf("SBI ON processing failed, error code:%x\n",ret);
printf("Press any key\n");
getch();
mdClose(path);
exit(0);
Size = 2;
StNo = 0xFF;
DevType = 5;
DevNo = 0x20;
ret = mdReceive(path,StNo,DevType,DevNo,&Size,&RecvBuf[0]);
if(ret!=0){
printf("mdReceive[SB43 read] processing failed, error code:%xYn";ret);
printf("Press any key\n");
getch();
mdClose(path);
exit(0);
}
if((RecvBuf[0] & 0x0800)!=0)
break;
Sleep(100);
// General counter
// Station number
// Device type
// Device number
// Sending data size
// Buffer for receiving
// Return value
// Confirm completion of switching
// Set the size of sending data
// Set the station number
// Set the device type (SB: equivalent to special M)
// Set the device number
// Exit from the loop if SB43 is on
// Wait for 100ms
MELSEC
4 - 33

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Q80bd-j61bt11n

Table of Contents