tashinz

MrPLC Member
  • Content count

    394
  • Joined

  • Last visited

Posts posted by tashinz


  1. If you reuse the values from function block then you should use new instance for every call (that would be e.g. if timer is used inside the block, if the same instance is called twice timer would not work properly, if it is called only once, which is the case when you use multiple instances, timer would work correctly), and if you do not (e.g. if you just have output = input * 23) you can use the same instance in every call.
    1 person likes this

  2. maybe something like this: let suppose you have an array of boolean with 50 members, i.e. booleanArray[50]. create internal variable index (INT) and output variable myOutput (INT). Then the code would be: FOR index := 0 TO 49 DO IF booleanArray[index] = TRUE THEN myOutput := index; END_IF; END_FOR; this would work only if you have one member of array to be TRUE, otherwise it would output the index of the last member which is TRUE. If i understood correctly your problem... regards
    1 person likes this

  3. try Project -> Run? If still not working, try to right click some .SR2 type of file (this cx-s runtime file extension), choose open with (if no such option right click the file holding shift key) and the from the opened window find cx-supervisor runtime application, select it and check the option something like allways use this application etc. regards

  4. there is a RET(93) instruction missing in a subroutine 39. you add rung before SBN(92) 41 (that is rung 104 in Section 6) with RET(93) instruction, compile and there is no errors. also, I couldn't open the project as it's called (probable there is non-ASCII chars) so I've renamed it and then I could open it. regards

  5. Well, this is the deal. ET200SP makes a difference between base modules (one to which you plug the IO modules and to which you can wire) as light and dark base units. I've taken into account that from the beggining since I put light base unit on the first place and other 5 dark units to the right of it. And when you do that in TIA Portal software (when configuring hardware) it is automatically done in project. But not i CX-Configurator. After I've found the parameter for each module that specifies whether the base unit is dark or light, and i specified the first base unit is light and others dark, everything works. By default, this paremeter is set to dark base unit. I hope this can help someone with similar problems. regards
    1 person likes this

  6. I have a following config: CJ2M-CPU33 with profinet IO controller CJ1W-PNT21 module. Remote IO is Siemens ET200SP with several DI, DQ and AI modules. I've downloaded the latest GSDML file for ET200SP, installed in CX-ConfiguratorFDT. I've configured everything and downloaded it, but there is no IO data exchange. According to LEDs on PNT21 it tries to establish IO exchange but on ET200SP ER led is blinking red, diag LED on first module is ON (green) and diag on other modules are flashing green. the config is ok, I've checked it several times. one might know that in ET200SP IO modules are inserted in base units which can be light and dark. the first module is allways plugged into light base module (which have to be wired to 24VDC source) and the rest (5 IO modules in my case) are plugged into dark base units (they are getting power from the unit on the left). Now, after all desperation, I've plugged out the first module (while power on) after which LEDs on PNT21 were ON (MS NS COMM and 100M) which means IO data exchange is established, and Diag on modules stopped flashing and turned ON, but ER on ET200SP was still blinking red. Then I plugged in the first module, ER is gone, all modules Diag are green, PNT21 LEDs are still ON and IO data exchange is performing which I've checked directly in PLC memory after wiring 24VDC to digital input. When PLC is sent to program mode or turned off, then back to RUN/Monitor or turned on, the errors are again present and there is no IO data exchange. if first module is taken out, then taken back, problem is solved, IO data exchange works. just to mention, in cx-config IO device error is reported as unknown error check for software updates. Has anyone dealt with similar configuration? with siemens et200sp? maybe someone has a workaround for this? thanx.

  7. you cannot scan the profinet network connected to the Ethernet port of plc. you have to connect your pc to the profinet network e.g. connect pc to switch, pnt21 (as part of plc) to switch and profinet distributed IO to the switch. then press scan (if I recall correctly) in cx-fdt and you'll get all your profinet devices on the list so you can configure them (give them names and addresses). regards

  8. on toolbar you have advance bit button. click it and place it on the screen. on the right side you have properties of this object you just created (if not, click on it). one is Tasks, click on it, window touch screen tasks list opens. on the left side select task turn bit ON, below that select tag (bit you want to set). on the right side, Press Tasks radio button should be selected. then click add button. then select radio button Released Tasks, and on the left side select Turn Bit OFF task and bellow find the same tag you used in previous step to set ON. then click Add. after this you will have one task in Press Tasks (saying Turn Bit YourTag ON) and one task in Released Tasks (saying Turn Bit YourTag OFF). regards.

  9. Use Advanced Bit Button and Select Task Turn Bit ON for Press Task and Turn Bit OFF for Released Task. For both tasks select the same bit of course.

  10. Don't use fixed path for destination of the report (like "c:\reports\machine1\report1.csv") but use text point which you can fill with characters freely, or you can use combination of text point and fixed part like MyTextPoint + "MyReport.csv". All this in GenerateReport command. or you can do what you did, and the use CopyFile command to copy your report to another or same folder but with different name.

  11. Not sure, but you shoud try to access the ETN21 using internet explorer. As i remember, there you can set up almost every parameter as in cx-programmer, and then you should restart only ETN21 unit. check the manual for accessing the unit using IE (or any browser). regards

  12. You don't need Omron opc server since you have a mitshubishi plc. you need Mitsubishi opc server or like you have chosen Kepware opc server which has a driver for many plcs including Mitsubishi. so, on this window you should select kepware opc as you did. What is the problem now? I've selected Omron opc since It is only opc server installed on my machine...

  13. After selecting a CX OPC Communication Control a windows opens: in a Server Name combo box select kepware opc server which should be installed on your computer (Here is Omron OPC selecte). Create a project by clickin new and give it a name. then, press OPC Groups / Items tab, you get: right click on left pane and add a group, and then right click on right pane and click Add Item (s) after which a window OPC Workspace browser opens with tags defined in Kepware OPC project (Omron OPC here), which you can then select and add them to the CX-Supervisor OPC project. Point is added: Press OK you get: where cx-supervisor tag called ujgh gets a value from opc tag New Point 1 (defined in Kepware project and which reads live data from PLC). in point editor it will be shown as: OK?

  14. Indeed good idea with kepware. create tags in kepware project. it's opc server and here you create all tags you need to monitor from scada. in cx-supervisor: go to point editor, add point, type a name, select a point type (Boolean, integer ...), I/O type would be input (if you monitor only) and I/O attributes would be OPC/Other, press Setup, dialogue opens, for server click an arrow then add and from list of available controls choose CX OPC Communication Control after which a property window is open where you should see kepware opc server on the list of server names. Create new project file (a file where cx-supervisor saves settings for opc this is not kepware project). then you should go to the OPC Groups / Items tab of the same window, create a group and add tags from the opc server. the rest is history...

  15. I think it's not possible from runtime, I first thought there are system memory variables for IP address but there aren't (NQ has that). So, if there is a way that would be the news for me. maybe the best way for you is to put ns and plc behind a router, and then never change the plc and ns ip addresses, only the router settings.

  16. A complete list of features supported by the particular version of cpu I am not aware where it can be found, but some of it one can find in cs cj programming manual and instruction reference manual. But I think the most convenient way is to check the cx-programmer's help for a particular command where at the end of every article you can find the Supported PLCs link to a table with all commands. this is for ladder instructions. for ST you'll get there buy pressing F1 in structure text editor and find Structured Text Functions, where you'll get the table. regards

  17. CX-Programmer's compiler is set to latest cpu's unit version so it checks program according to features supported by that unit version. when you connect to plc it can detect the cpu unit version. But you can change the cpu unit version compiler is using: go to menu PLC - > Program Check Options and in that window you can change amongst other things the unit version of cpu. then the compiler will show errors offline also. remedy for this is to buy newer plc or to solve your conversion in ladder. what you used, is supported from cpu unit version 4.0. regards

  18. you can extract info from A351, 352 etc words in scada and create a textual point containing a date and time information. you can create it in datetime format SQL Server uses (something like 2013-12-09 11:45:23 but I am not sure if this depends on regional settings - i think not since this is I suppose some standard. also, I think in SQL Server's datetime format there are miliseconds). this way you can treat later in SQL statements field Date_Time as datetime type. you can do that in plc also - create a string with date and time. for plc or scada conversion try this: (* this is ST code you can put this in FB. similar is for SCADA *) MySecond := MOD(WORD_BCD_TO_UINT (mmss), 100); (* mmss is A351 *) MyMinute := WORD_BCD_TO_UINT (mmss) / 100; MyHour := MOD(WORD_BCD_TO_UINT (DDHH), 100); (* DDHH is A352 *) MyDay := WORD_BCD_TO_UINT (DDHH) / 100; MyMonth := MOD( WORD_BCD_TO_UINT (YYMM), 100); (* YYMM is A353 *) MyYear := WORD_BCD_TO_UINT (YYMM) / 100 + 2000; Date_Time := UINT_TO_STRING(MyYear) + '-' + UINT_TO_STRING(MyMonth) + '-' + UINT_TO_STRING(MyDay) + ' ' + UINT_TO_STRING(MyHour) + ':' + UINT_TO_STRING(MyMinute) + ':' + UINT_TO_STRING(MySecond); (* end of code *) Where Date_Time is in/out since editor doesn't allow string type as only output: Date_Time STRING EXTERNAL 0 20 Watch out for data format, A351 ... A353 are UINT_BCD therefore the conversions. since you use A351...A353 for creating your timestamps for alarms I suppose they too are of UINT_BCD. regards