hmwright

MrPLC Member
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About hmwright

  • Rank
    Sparky

Profile Information

  • Country Australia
  1. PME RX3I Ladder MIN Select

    Hi Team; I am trying to determine if there is a way to find the lowest of four int values without using 30 instructions. It seams the GE RX3i PLC does not have a MAX or MIN function. This is made even harder by having to be in Ladder. Any help would be most appreciated.
  2. Citect Scada Modent Bit Read

    Hi Wasan;   thanks for your input, yes when using the 45052.0 through 45052.15 format the signals were assigned as Digital. 
  3. Citect Scada Modent Bit Read

    Hi team; I am struggling with a Citect SCADA read of some data. The system is using the "Modnet3" driver over TCP/IP to talk with a system (Modnet 3 as its TCP/IP with first register at 0 and 0 to 15 bits). I am reading the modbus data into variables which is working fine for the analogue values all defined as real in citect. The Issue I have is that the driver help says I can direct reference a bit in a word, in my case address 45052.1 Holding register 45052 and Bit 1. If I read this as a UINT I get a value of 147 corresponding to bits 1,2,5 and 8. Citect generates no errors for the tag setup where I define 45052.0 through 45052.15 but all remain as zero in tag lists.  Any help would be fantastic Kindest Regards Howard
  4. Yokogawa Fast Tools

    Hi All; Does anybody here have a copy of Fast tools 10.02. It can like Citect be run for 1 hour in demo mode which is ideal to asses its capability. We are looking at having to use it but would like to review in demo first. Local Distributor is not providing much assistance.
  5. Great news slimskism. I used your concept and switched to the newer citect SQL commands and ended up only needing the one script (below) and using SQLappend to keep making the SQL text string longer. Even amazed myself. Thanks for your help. In the first part I still read tags in to an array as initial post but function now as below:-   FUNCTION SQL_INSERT_lds() // Loop FOR number of tags (16 lots of 30 min) TO be read adding to array Variables INT i;     FOR i = 0 TO 31 DO         tagval = TagRead(tagname);     END      // Open ODBC connection TO CitectDB configured in ODBC Manager with DSN_SQL INT hSQL;      hSQL = SQLConnect("DSN=DSN_SQL"); //* IF connection IS OK, set the begining of a SQL transaction IF hSQL <> -1 THEN     SQLSet(hSQL, "INSERT INTO lds (dateandtime,S0000,S0030,S0100,S0130,S0200,S0230,S0300,S0330,S0400,S0430,S0500,S0530,S0600,S0630,S0700,S0730,");     SQLAppend(hSQL, "S0800,S0830,S0900,S0930,S1000,S1030,S1100,S1130,S1200,S1230,S1300,S1330,S1400,S1430,S1500,S1530) VALUES ");     SQLAppend(hSQL, "(SYSDATETIME(),'"+tagval[0]+"','"+tagval[1]+"','"+tagval[2]+"','"+tagval[3]+"','"+tagval[4]+"','"+tagval[5]+"','"+tagval[6]+"','"+tagval[7]+"','"+tagval[8]+"','"+tagval[9]+"','"+tagval[10]+"','"+tagval[11]+"','"+tagval[12]+"','"+tagval[13]+"','"+tagval[14]+"','"+tagval[15]+"',");     SQLAppend(hSQL, "'"+tagval[16]+"','"+tagval[17]+"','"+tagval[18]+"','"+tagval[19]+"','"+tagval[20]+"','"+tagval[21]+"','"+tagval[22]+"','"+tagval[23]+"','"+tagval[24]+"','"+tagval[25]+"','"+tagval[26]+"','"+tagval[27]+"','"+tagval[28]+"','"+tagval[29]+"','"+tagval[30]+"','"+tagval[31]+"')");     SQLExec(HSQL, "");     SQLEnd(hSQL);     SleepMS(100);     SQLDisconnect(hSQL); ELSE     Message("Error Message","SQL TRADING DAY DATABASE WRITE FAIL",48); END END  
  6. Thanks; It looks like "CSV_DB_execute" was a citect 2015 command and appears in that help. We are suing 2018R2 and this CSV set seems to be missing. If I master the concept then I may be able to get it to work with the "SQLExec" command. In the scripts I also note a few @dEventTime and @sAction. I am assuming the d and s refer to datatype ? IS this referenced anywhere ? Thanks again for the assistance
  7. Thankyou very much. I see a different way of connecting to the MSSQL instance. Whilst trying to understand what this code is I cant reference "CSV_DB_Execute" which appears to be the db connect? is this cicode or cicodeVBA? Also is you application running a seperate query ? "qryInsertOperatorLog" or is this just a tagger event? can you also clarify what "gsPrimaryConnection" is. Sorry to be a pain but I connected using DSN and this is a new method to me which I cant find in cicode reference. Really appreciate the guidance here.
  8. I am having a problem getting citect to write to my sql database.  Whilst it will write I am restricted by the length of a single cicode command. I think its 255 characters. For my problem I am trying to write 48 tags to the database in one write command to obtain 1 time stamp. Is it possible to write multiple times to the same tables row ? Currently when I write a new row is created at the given timestamp. the cicode is attached. A solution would be to do 4 writes of 12 tags at a time but all would need to go in the same MSSQL table row. I'm ok using the data instead of time and date as this write only happens once each day Any help would be awesome..   *********************************************************************************************************************************** /* **    FILE:        SpurLoad.CI ** * Load Tags from Citect in TO temp array */ STRING tagname[24]="M340_PwrCtrl_SLD0000","M340_PwrCtrl_SLD0030","M340_PwrCtrl_SLD0100","M340_PwrCtrl_SLD0130","M340_PwrCtrl_SLD0200","M340_PwrCtrl_SLD0230","M340_PwrCtrl_SLD0300","M340_PwrCtrl_SLD0330","M340_PwrCtrl_SLD0400","M340_PwrCtrl_SLD0430","M340_PwrCtrl_SLD0500","M340_PwrCtrl_SLD0530","M340_PwrCtrl_SLD0600","M340_PwrCtrl_SLD0630","M340_PwrCtrl_SLD0700","M340_PwrCtrl_SLD0730","M340_PwrCtrl_SLD0800","M340_PwrCtrl_SLD0830","M340_PwrCtrl_SLD0900","M340_PwrCtrl_SLD0930","M340_PwrCtrl_SLD1000","M340_PwrCtrl_SLD1030","M340_PwrCtrl_SLD1100"; /* add array TO hold values */ STRING tagval[24]; INT hSQL; FUNCTION SQL_INSERT_lds() /* Loop FOR number of tags (13 lots of 30 min) TO be read adding to array Variables */ INT i;     FOR i = 0 TO 21 DO              tagval = TagRead(tagname);              END      /* Open ODBC connection TO CitectDB configured in ODBC Manager with DSN_SQL */          hSQL = SQLConnect("DSN=DSN_SQL"); /* IF connection IS OK, insert in TO table "lds" the values */ IF hSQL <> -1 THEN     SQLExec(hSQL, "INSERT INTO lds (dateandtime,S0000,S0030,S0100,S0130,S0200,S0230,S0300,S0330,S0400,S0430,S0500,S0530,S0600,S0630,S0700,S0730,S0800,S0830,S0900,S0930,S1000,S1030) VALUES (SYSDATETIME(),'"+tagval[0]+"','"+tagval[1]+"','"+tagval[2]+"','"+tagval[3]+"','"+tagval[4]+"','"+tagval[5]+"','"+tagval[6]+"','"+tagval[7]+"','"+tagval[8]+"','"+tagval[9]+"','"+tagval[10]+"','"+tagval [11]+"','"+tagval[12]+"','"+tagval[13]+"','"+tagval[14]+"','"+tagval[15]+"','"+tagval[16]+"','"+tagval[17]+"','"+tagval[18]+"','"+tagval[19]+"','"+tagval[20]+"','"+tagval[21]+"')");     SQLEnd(hSQL);     SleepMS(100); SQLDisconnect(hSQL); ELSE     Message("Error Message","SQL TRADING DAY DATABASE WRITE FAIL",48); END END   SpurLoad.ci
  9. Issue was a data type, THE variable to write was an INT and the read variable as a string from OPC Lines Changed to:- M340PLC_R03kW = strtoint (Sub03Substation3PowerkWtot); Thanks
  10. I am trying to write some citect variables back to the PLC. I have made a startup cicode script which is suppose to copy one variable to another which I found on the web. I am not sure if just using tag = tag is OK in citect 2018. Any help would be fantastic.   Cicode below: *********************** FUNCTION StartUpFunction()     INT hMyTask;     // Start a new task that runs all the time and transfers values using writetag     hMyTask = TaskNew("fnDoThis","",0); END FUNCTION fnDoThis;     //Never Stop this Loop     WHILE 1 DO         //Update the first Tag         TagWrite ("M340PLC_R02kW",Sub02Substation2PowerkWtot)         M340PLC_R03kW = Sub03Substation3PowerkWtot         M340PLC_R04kW = Sub04Substation4PowerkWtot         M340PLC_R05kW = TerminalSubstation_5InstantaneousPowerkWtot         M340PLC_R06kW = TerminalSubstation_6PowerkWtot         M340PLC_R07kW = Sub07Substation7PowerkWtot         M340PLC_R08kW = Sub08Substation8PowerkWtot         M340PLC_R09kW = Sub09Substation9PowerkWtot         M340PLC_R10kW = M340PLC_G1_GEN_FREQ_PV         M340PLC_R11kW = Sub11Substation11PowerkWtot         M340PLC_R12kW = Sub12Substation12PowerkWtot         M340PLC_R13kW = Sub13Substation13PowerkWtot         M340PLC_R14kW = Sub14Substation14PowerkWtot         M340PLC_R15kW = Sub15Substation15PowerkWtot         M340PLC_R16kW = Sub16Substation_16PowerkWtot         M340PLC_R17kW = TerminalSubstation_17PowerkWtot         M340PLC_R18kW = Sub18Substation18PowerkWtot         M340PLC_R19kW = Sub19Substation19PowerkWtot         M340PLC_R20kW = M340PLC_G1_GEN_FREQ_PV                 M340PLC_R21kW = Sub21Substation21PowerkWtot         M340PLC_R22kW = Sub22Substation_22PowerkWtot         M340PLC_R23kW = Sub23Substation_23PowerkWtot         M340PLC_R24kW = Sub24Substation_24PowerkWtot         M340PLC_R25kW = Sub25Substation25PowerkWtot         M340PLC_R26kW = Sub26Substation26PowerkWtot         M340PLC_R27kW = Sub27Substation27PowerkWtot         M340PLC_R28kW = Sub28Substation28PowerkWtot         M340PLC_R29kW = Sub29Substation29PowerkWtot         M340PLC_R30kW = M340PLC_G1_GEN_FREQ_PV         M340PLC_R31kW = M340PLC_G1_GEN_FREQ_PV         M340PLC_R32kW = PV2_SSB1PowerMeterPowerkWtot         M340PLC_R33kW = PV2_SSB2PowerMeterPowerkWtot         M340PLC_R34kW = M340PLC_G1_GEN_FREQ_PV         M340PLC_R35kW = M340PLC_G1_GEN_FREQ_PV         M340PLC_R36kW = M340PLC_G1_GEN_FREQ_PV         M340PLC_PQM3_WATTS_PV = HV_MetersBunnings_Intake_StnPowerkWtot         M340PLC_SOL01_SSB1_KW = SolarSSB1PowerMeterPowerkWtot         M340PLC_SOL01_SSB2_KW = SolarSSB2PowerMeterPowerkWtot         M340PLC_SOL01_SSB3_KW = SolarSSB3PowerMeterPowerkWtot         M340PLC_SOL01_SSB4_KW = SolarSSB4PowerMeterPowerkWtot         //Go to sleep for 1 second so as to not overload CPU         Sleep(1)     //Go back to start of Loop     END //End of Function END  
  11. Thanks, Already have and read it, still no luck
  12. M340 csv File Read

    I did see this link although it says possible it gives no reference to how it can be done, as its heading says there are no examples. Thanks
  13. I have an application where data gets placed in a csv file. I need to read data from this file in to memory of a M340 PLC. Is there a way to program the M340 PLC to open and read the file in to an array or is this not possible at the PLC. Looked through google with little success.
  14. Please find attached Modbus Manual and User Manual. The 1 offset only seams to apply when using ReadVar and not IO scanning, I did make sure there was no overlap. GenComm2.162 DSE8610-MKII-Operator-Manual.pdfApril 2018.docx
  15. Thanks cHud; Please see set up for scanning two sets from the same device.