MrPLC Member
  • Content count

  • Joined

  • Last visited

Everything posted by AndrejP

  1. CJ2m Time as millis()

    Hello. I'm using CX-Programer and CJ2M CPU. Is it possible to get current time in ms like in arduinos millis()? Thanks. BR.
  2. Structure Text REAL constant

    I guess it has something to do with Regional Format (SL). I have to use comma (1000,0) instead of dot (1000.0).... In other software which uses structure text, I didn't have this kind of problem... BR.  
  3. Structure Text REAL constant

    Hello. I'm having difficulties of how to write REAL constant in ST. For example (Gap1 is defined as REAL): Gap1:= UDINT_TO_REAL(P_Cycle_Time_Value) / +1000.0;     RETURNS ERROR ERROR:   Conversion cannot convert from Integer Literal to REAL I have also tried 1000.0 If I use:  Gap1:= UDINT_TO_REAL(P_Cycle_Time_Value) / INT_TO_REAL(1000);  COMPILES OK My question.. How do I write REAL constant in Structure text? I don't want to use  INT_TO_REAL anytime I want to do calculations with constants.. Thanks. BR.
  4. CJ2m Time as millis()

    Thanks for replay.  But I don't want to mess with Cycle Time. The question is: Can I get current time/date (UDINT) in miliseconds? (Similar as arduino millis())? Thanks. BR.
  5. CJ2m Time as millis()

    Hello. I'm trying to develop Tau filter wich uses time calculations like this: TimeNew := GetTime() // system time in miliseconds ExpTime := TimeNew - TimeOld TimeOld := TimeNew I guess I colud use CycleTime, but the resoult for CycleTime is not constant... 
  6. Hello. I can't find any related bits wich would indicate PLC offline / online status. I'm using two PLC's. PLC0 Modbus TCP (Ethernet) PLC1 Modbus RTU (Serial) Please help me to get online status. BR, Andrej. 
  7. NS15 - Data Log Graph Decimals

    Hello.I'm having variable Voltage expressed as UNSIGNED DOUBLE INT.For example: Val = 23423For displaying the right value I have to divide value by 100 ... Val/100 = 234.23V.For showing the value I can set the decimal place to 2 and Unit&Scale to 1002.The problem is:THE GRAPH IS SHOWING Val=23423. I WOULD LIKE TO SHOW Val=234.23.HOW CAN I USE THE DECIMAL PLACES IN GRAPH?WHERE CAN I SET THIS SETTING?Thanks.BR, Andrej.
  8. PLC TCP/IP simulator

    Hello. I'm developing NS5 HMI visualization. The display is using TCP/IP comunication.  (IP: communicating with PLC (IP: - my PC) I would like to start PLC (CJ2M) simulator on my PC (IP: so that HMI would comunicate with my PS (PLC Slave simulator) Does the simulator exists? Thanks. BR, Andrej.
  9. Log In

    Hello. I'm using CX-Designer. I would like to create a BUTTON with label Log In. When I press that button it should: 1. PopUp keyboard would appear 2. I would enter login password for example 0000 3. Entered password would write to PLC location D1000 How can I do that? Please help. BR, Andrej.
  10. Log In

    Hello. Thanks for sample. But I would like to hide the input field (password). I tried to do this with setting: - Control Flag: Display: Hidden. But then the function does not work. Do you have any other suggestions? Thanks. BR, Andrej.   PS: I can move the input field off the screen, but I think this is not the best solution.
  11. Scaling Data in CJ1/CS1 PLCs...

    Even simplier way is to use function block... BR, Andrej.
  12. Online edit - Insert Section

    Hello. Is it possible to add SECTION using ONLINE EDIT? I can add rung... Thanks. Best regards.
  13. S7-300 Citect S7NT

    Hello. I'm trying to comunicate to Siemens S7-300 using Citect S7NT driver. I haven't done this so far so I'm asking you for help. What software do I need to successfully comunicate with S7? How do I set S7NT CITECT driver (Board, port, device,...)? Thanks. Best regards.
  14. CITECT SCADA 6.1 + Microsoft SQL Express 2008

    But now I have another problem. In Citect Nexa 6.1 I'm using conn string: hSQL = SQLConnect(" Driver={SQL Server};Server=PC_NAME\SQLEXPRESS;Database=MyDatabase;Uid=User;Pwd=Password) It connects without problems. If I use Querystring: SELECT * FROM MyDataTable it works. I've got values from table. BUT!!! If I use more complicated Querys like Queriing a Subquery (IT WORKS IN SCADA 2016 and in SQL SERVER MANAGEMENT STUDIO): SELECT * from (     SELECT *      from mytable ) subquery I've got error: 4501Unexpected text at end of SQL query 'FROM' Does someone have any advise? Thanks. Best regards.    
  15. Hello. I'm trying to connect to Microsoft SQL Server (2008 EXPRESS), but the connection is not working. I have done this in Citect SCADA 2018 without any problems using connection string: hSQL = SQLConnect("SCADA Data Provider=SQLClient.....) How can I connect to MS SQL Server using Citect 6.1? Thanks. Best regards.
  16. CITECT SCADA 6.1 + Microsoft SQL Express 2008

    Hello. The Citect Nexa 6.1 is running on WIN7 machine. The Citect 2016 is on different machine using WIN10 If you are using MSSQL-Wxpress, The connection string using CITECT 2016 is: hSQL = SQLConnect("SCADA Data Provider=SQLClient;Persist Security Info=False;Integrated Security=true;Initial Catalog=mydatabase;User ID=User;Password=Password;server=PC_NAME\SQLEXPRESS;")  
  17. CITECT SCADA 6.1 + Microsoft SQL Express 2008

    I have tested this on Citect SCADA 2016. It DOES NOT WORK in this version...
  18. CITECT SCADA 6.1 + Microsoft SQL Express 2008

    Hello.  Wasan Thanks for answer. I helped myself with "Database Exchange Controll" to build connection string. The result for successfull connection was (almost the same as yours): hSQL = SQLConnect("DSN=SQLDatabase_Name;UID=UserName;PWD=Password;APP=CITECT;WSID=ComputerName;DATABASE=SQLDatabase_Name;") Best regards, Andrej.          
  19. Hello. How can I get bit addressing of defined variable in function block? For example: - I define variable type DUINT with name Double_VarI_INT. - I want to get or set one bit out of it (its double word). - If I use Double_VarI_INT.0 I got error. Best regards.
  20. OMRON ODD or EVEN value

    Hello. I have figured out... It's simple You declare UINT variable as array dimension 2. Then you can use Var[0] as word R and Var[1] as reminder R+1. Best regards...    
  21. OMRON ODD or EVEN value

    Hello. How can I easely determen if for example the value in DM100 is ODD or EVEN? Thanks.
  22. OMRON ODD or EVEN value

    Thanks for answer. I have allready figured out I can use reminder. Problem is that I need to do this in Function Block. I declare variable as UDINT. The program automatically assign address to this variable. The sollution would be assigning fixed memory allocation. But I would like to avoid using fixed memory allocation (when declaring variable).  How can it be done this by looking at the R+1 (reminder) of declared variable? Best regards.

    Hello. How can I divide in MODULAR way? DM100 MOD DM101. Thanks. Best regards, Andrej.