Abd Alrhman Hammal
Published © GPL3+

Hexabitz RS485 Controlling Schneider VFD

Controlling Schneider VFD using Modbus RTU by RS485 Hexabitz module "H1DR1".

IntermediateProtip3 hours391
Hexabitz RS485 Controlling Schneider VFD

Things used in this project

Hardware components

Hexabitz H1DR1x
×1
Variable Speed Drive, Altivar Machine ATV340
Variable Speed Drive, Altivar Machine ATV340
×1

Software apps and online services

STM32CubeMonitor

Story

Read more

Code

Messages frame

C/C++
you have to understand Modbus protocol to solve the function here.
#define SlaveAdd2 2
#define cmdaddress 8501
#define frqaddress 8602
#define cfrqaddress 8604 

uint8_t	first_param;
uint16_t	second_param;
	
main()
{
  for(::)
  {
    shnider_vfd(first_param,second_param);
  }
}


extern void shnider_vfd(uint8_t cmd,uint16_t freq)
{


		switch(cmd){
		///////Writing speed
			case 1:


			freq=freq*30;
				WriteModbusRegister(SlaveAdd2,frqaddress, freq) ;
	

			break;

			//////////run motor
			case 2:


	  	WriteModbusRegister(SlaveAdd2,cmdaddress, 6);
	

			break;
			/////ready motor
			case 3:
				
				WriteModbusRegister(SlaveAdd2,cmdaddress, 7) ;

			break;
			/////start motor
			case 4:
				WriteModbusRegister(SlaveAdd2,cmdaddress, 15) ;

			break;
			
			
			default:
				
			ReadModbusRegister(SlaveAdd2,cfrqaddress,1, DataRcv);


			break;			
		}
}

Credits

Abd Alrhman Hammal
5 projects • 16 followers
firmware programmer
Contact

Comments

Please log in or sign up to comment.