khm

Members
  • Content count

    17
  • Joined

  • Last visited

Everything posted by khm

  1. Hi, Is there a ready library for PID control available for MSP430F5438A or G2553 controllers. Please help if an example is available for the same. Thanks, Tanmay
  2. Hi, I am using the web client demo to send an HTTP GET request to a web server to read the data in json format. However the web server returns an error code 301 page moved error. How do I redirect my request to the new location? Does the ethernet library for TIVA support SSL HTTP GET requests?
  3. @@Rei Vilo Please Reply
  4. 0down votefavorite Hi, I am trying to implement Modbus TCP on TIVA 1294 using the following code. I am using a modbus slave simulator on a pc to check the following code. However, the code doesn't seem to be working. I have downloaded the code & the libraries fromhttp://myarduinoprojects.com/modbus.html. Please suggest me corrections if necessary. Also is there another working example available for modbus tcp/ip for ethernet on TIVA energia? Please guide. #include <SPI.h> #include <Ethernet.h> #include "MgsModbus.h" MgsModbus Mb; int inByte = 0; // incoming serial byte // Ethernet settings (depending on MAC and Local network) byte mac[] = {0x00, 0x1A, 0xB6, 0x02, 0xD1, 0x14 }; IPAddress ip(192, 168, 0, 35); void setup() { // serial setup Serial.begin(9600); Serial.println("Serial interface started"); // initialize the ethernet device Ethernet.begin(mac, ip); // start etehrnet interface Serial.println("Ethernet interface started"); // print your local IP address: Serial.print("My IP address: "); for (byte thisByte = 0; thisByte < 4; thisByte++) { // print the value of each byte of the IP address: Serial.print(Ethernet.localIP()[thisByte], DEC); Serial.print("."); } Serial.println(); // slave address Mb.remSlaveIP = (192,168,0,1); // Fill MbData // Mb.SetBit(0,false); Mb.MbData[0] = 1; Mb.MbData[1] = 2; Mb.MbData[2] = 3; Mb.MbData[3] = 4; Mb.MbData[4] = 5; Mb.MbData[5] = 6; Mb.MbData[6] = 0; Mb.MbData[7] = 0; Mb.MbData[8] = 0; Mb.MbData[9] = 0; Mb.MbData[10] = 0; Mb.MbData[11] = 0; // print MbData for (int i=0;i<12;i++) { Serial.print("address: "); Serial.print(i); Serial.print("Data: "); Serial.println(Mb.MbData); } // print menu Serial.println("0 - print the first 12 words of the MbData space"); Serial.println("1 - FC 1 - read the first 5 coils from the slave and store them in the lower byte of MbData[1]"); Serial.println("2 - FC 2 - read the first 5 discrete inputs from the slave and store them in the higer of the MbData[1]"); Serial.println("3 - FC 3 - read the first 5 registers from the slave and store them in MbData[3..7"); Serial.println("4 - FC 4 - read the first 5 input registers from the slave and store them in MbData[8..12]"); Serial.println("5 - FC 5 - write coil 0 of the slave with the bit valeu of MbData[0.0]"); Serial.println("6 - FC 6 - write register 0 of the slave with MbData[2]"); Serial.println("7 - FC 15 - write 5 coils of the slave starting with coil 0 with GetBit(16..20"); Serial.println("8 - Fc 16 - write 5 registers of the slave starting on register 0 with MbData[0..4]"); Serial.println(Mb.remSlaveIP); } void loop() { if (Serial.available() > 0) { // get incoming byte: inByte = Serial.read(); if (inByte == '0') { // print MbData for (int i=0;i<12;i++) { Serial.print("address: "); Serial.print(i); Serial.print("Data: "); Serial.println(Mb.MbData); } } if (inByte == '1') {Mb.Req(MB_FC_READ_COILS, 6,6,6);} // 1 // ref, count, pos if (inByte == '2') {Mb.Req(MB_FC_READ_DISCRETE_INPUT, 6,6,6);} // 2 if (inByte == '3') {Mb.Req(MB_FC_READ_REGISTERS, 6,6,6);} // 3 if (inByte == '4') {Mb.Req(MB_FC_READ_INPUT_REGISTER, 6,6,6);} // 4 if (inByte == '5') {Mb.Req(MB_FC_WRITE_COIL, 0,0,0);} // 5 // count can be x if (inByte == '6') {Mb.Req(MB_FC_WRITE_REGISTER, 7,0,0);} // 6 // count can be x if (inByte == '7') {Mb.Req(MB_FC_WRITE_MULTIPLE_COILS, 0,6,0);} // 15 if (inByte == '8') {Mb.Req(MB_FC_WRITE_MULTIPLE_REGISTERS, 0,6,0);} // 16 } Mb.MbmRun(); // Mb.MbsRun(); } Thanks.
  5. Hi, I want to implement a code for Modbus RTU over TCP/IP usng TM4C1294NCPDT launchpad. Does anyone know a library which can be used to implement it. Also is it possible to obtain data from a PLC using modbus TCP/IP and send it to a Server on cloud using the same ethernet port? Please help. Thanks.
  6. Hi , I have written a code for ethernet client using TM4c1294NCPDT launchpad and I am sending data to a server at api.pushingbox.com. The code sends data to the server after every 15 seconds, It works all the time, however sometimes suddenly the ethernet data transfer hangs, the microcontroller does not hang. Below is the void loop() I have used.Please help. void loop(){ kemasData(); //packing GET query with data Serial.println("connecting..."); if (client.connect(server, 80)) { sendData(); // koneksi = true; //connected = true u.count++; Serial.println(length); length = 0; EEPROM.write(0,u.b[0]); EEPROM.write(1,u.b[1]); Serial.println("conn serv"); } else{ Serial.println("connection failed"); } // loop while(client.connected()){ while (client.available()) { char c = client.read(); //save http header to c Serial.print(c); //print http header to serial monitor } //Serial.print("-"); } if (!client.connected()) { Serial.println(); Serial.println("disconnecting."); Serial.print("Count :"); Serial.println(u.count); //print sent value to serial monitor client.stop(); Serial.println("Client Stopped"); // koneksi = false; Serial.println("koneksi = false"); data = ""; //data reset } delay(15000); // interval } When I check the serial port the code hangs at conn serv printed above.
  7. How do I calculate the timing for watchdog reset?
  8. How do I calculate the timing for watchdog reset? @@energia
  9. Hi, Can someone help me to implement an internal RTC module code in TIVA TM4C1294NCPDT using Energia? Thanks.
  10. Its unclear as to what I have to comment exactly in the above part. Or can you just paste the code which I need to use to implement the RTC in TM4c1294NCPDT? Thanks.
  11. Line 43 contains include "Wiring.h". Where do I specify the MCU?@@Rei Vilo
  12. I have added the RTC library in Energia under hardware/lm4f/libraries, but I am getting the following error when I compile the example code for MSP432 . I have selected the TM4C1294ncpdt board for this code. What changes and where are to be implemented if any? [D:\Installer\energia-0101E0016\hardware\tools\lm4f\bin\arm-none-eabi-g++, -c, -Os, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=16, -ID:\Installer\energia-0101E0016\hardware\lm4f\cores\lm4f, -ID:\Installer\energia-0101E0016\hardware\lm4f\variants\launchpad_129, -ID:\Installer\energia-0101E0016\hardware\lm4f\libraries\RTC_Library, C:\Users\tanmay\AppData\Local\Temp\build6234340672184416431.tmp\MSP432_RTC.cpp, -o, C:\Users\tanmay\AppData\Local\Temp\build6234340672184416431.tmp\MSP432_RTC.cpp.o] In file included from MSP432_RTC.cpp:81:0: D:\Installer\energia-0101E0016\hardware\lm4f\libraries\RTC_Library/RTC_Library.h:43:3: error: #error Platform not supported. # error Platform not supported. Please help . Thanks. ^
  13. Hey, Thanks a lot for your prompt reply. Site looks helpful.Would go through it. -Khm
  14. Hi, I am not from the field of IT and do not know how to design webpages. I want to design a webpage/dashboard for real time monitoring of remote data using Tiva. I have referred freeboard.io and few other resources, but I am unable to find any customizable dashboard which has user management and alert facilities. Can anyone suggest me some tool with which I can design my own website/dashboard for IOT (drag-drop preferably)? Thanks.
  15. Hi, Is it possible to add a custom board/ circuit to energia? If yes, please guide me with the procedure for the same. Thanks
  16. Hi, I have built a code in CCS v6 for TM4C1294 for Modbus RTU Master/ Slave using basic C programming and Driver Libraries. I want to combine it with an Energia Sketch for Ethernet Client. Is this possible, please guide me with an example if possible. Thanks.
  17. Hi, I have downloaded some libraries which have been created for arduino(Modbus Master / Slave). I want to use them with TIVA Launchpad 129. I have compiled them in Arduino IDE successfully. However, when I compile them using Energia after selecting Launchpad 129, I get some errors related to Hardware_Serial.h. I would like to know what changes are to be done in Energia to compile without errors. I have attached Modbus Master library for reference. SimpleModbusMasterV12.rar