How to read and write CSV file data from HMI using Macros

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 6

  • @fgfimpianti
    @fgfimpianti 2 дня назад

    Hello, could you please share the project? I tried to do as the video but csv file has not created. Thanks

  • @CarlosDiasA
    @CarlosDiasA 5 месяцев назад

    Hello, is it possible to make SQL queries using macros? I tried to compile some ODBC codes without success.

  • @ytmaxi2570
    @ytmaxi2570 Год назад +1

    Hello, can you please share and paste here the macro text code?

    • @KincoAutomation
      @KincoAutomation  Год назад

      #include "macrotypedef.h"
      #include "math.h"
      #include "stdlib.h"
      #include "stdio.h"
      #include "string.h"
      //#include
      //#include
      //#include //open
      //#include // close read write
      int MacroEntry()
      {
      unsigned int index = 0;
      unsigned int indexValue = 0;
      char res[10] = {0};
      int i =0; short num=1;
      char FileName[64] = {0};
      FILE * File_fp;
      ReadLocal("LW",100,32,FileName,0);
      File_fp = fopen(FileName,"r");
      while(fscanf(File_fp, "%x,%d,%s
      ", &index, &indexValue,res) != EOF)
      {
      if(strcmp(res,"True")==0)
      {
      WriteLocal("ELW",i,1,&num,0);
      WriteLocal("ELW",i+1,2,&index,0);
      WriteLocal("ELW",i+3,2,&indexValue,0);
      i=i+5;num ++;
      }
      }
      fclose(File_fp);
      return 0;
      }

    • @ytmaxi2570
      @ytmaxi2570 Год назад +1

      @@KincoAutomation Thanks a lot

  • @bensouissiwajdi6180
    @bensouissiwajdi6180 9 месяцев назад

    can you share the application with us please!