Search talk: compare function block

 
<< < 1 .. 22 23 24 25 26 > >> (Page 24 of 26)

Post by joep on overruling kinematic limits of [-90°, 90°] in bipod_rotary CODESYS Forge talk (Post)
Hi All, for my robotics application we are building a 2-axis parallel scara using the kin_bipod_rotary kinematics. Codesys implemented limits of [-90°, 90°] according to the documentation: https://content.helpme-codesys.com/en/libs/SM3_Transformation/Current/SM3_Transformation/Function-Blocks/Positioning-Kinematics/Parallel-Systems/Kin_Bipod_Rotary.html Would it be possible to overrule these limits somehow, our mechanical limits are more in the range of [-110°, 135°] In this range we also don't encounter point where singularity is an issue. Hopeful someone knows a solution, Best regards, Joep
Last updated: 2024-09-04

Post by ralfki on User management CODESYS Forge talk (Post)
Hello eschwellinger, at first thank you for your answer. So the only ways to activate the user management are CodeSys delevelopment enviroment and the Codesys Automation Server. So there is no function to activate the user management via code? Do you have an idea how to get back the users when somebody replaced the PLC. Our customers have only our own developed visualization and they also don't want to install further softwares. Do you maybe have a solution for this
Last updated: 2024-09-04

Post by mani-i4point0 on Codesys (Ethernet IP Scanner ) and Python (Ethernet IP Adapter) CODESYS Forge talk (Post)
Hi, I am currently developing the software to establish the communication and data transfer between Python Module as a Ethernet IP - Adapter coding is running my laptop and Codesys as a Ethernet IP scanner in the resperry PI hardware. I am trying to look for some available recourses online, Can anyone suggest me to develop this function in Codesys and Python ? Best Regards, Mani
Last updated: 2024-09-24

Post by amy123 on codesys mqtt publish serialization CODESYS Forge talk (Post)
Hello, I am using the CODESYS IIoT Libraries SL MQTT Publish. Does this publish block only support publishing STRINGS as a readable format? I can publish ENUM, STRUCT, BOOL; however, MQTT Explorer will only display strings. When I use Wireshark, I can see that it is publishing something, but it looks to be publishing a serialized version which is a bunch of 0s or random text. If so, is there any way to deserialize this information back into a readable format? See pictures, where I have a BOOL TRUE that gets published as 001. Then see where I publish a STRUCT and it's an incomprehensible combination of 0s - only the string variable is displayed. Or, is it expected that you convert everything to a string before publishing? Any help is greatly appreciated! :)
Last updated: 2024-02-16

Post by esave on OPC UA Server with on Codesys + OPC UA Client on Labview CODESYS Forge talk (Post)
Hello everyone I want a communication between my PLC as an OPC UA Server and Labview on my PC as the OPC UA Client. I have an Festo CPX-E-CEC-C1-PN PLC and I have the OPC UA Toolkit from Labview. I created some Variables for testing (see picture 1) on Codesys. I tried to use this Labview block diagram (see picture 2) but I cant connect the PLC to it. What do I have to type in the Server Endpoint URL and what in the Node ID? Is this a good way for communication with a PLC to a PC? If not is there another way?
Last updated: 2024-04-12

Post by tayhim on WAGO HMI Device not found CODESYS Forge talk (Post)
Hello, I'm trying to connect with a Wago TP600 HMI but without success. I'm using codysis 3.5 SP19 patch 7 (SP20 block all the time) and the official wago package is installed. However, when I scan and select my device, I get a message saying that the device doesn't match the project's device object with the possibility to update the device (as shown in the attached picture). however, after choosing to update i got a message that the device is not found. I've tried with a new empty project but the same results. do you have any ideas? Thanks.
Last updated: 2024-06-25

Post by programmierer on UDB Block in Codesys V2.3 implementieren um Werte an bestimmte IP-Adresse zu senden CODESYS Forge talk (Post)
Hallo zusammen, ich möchte mich hiermit an euch wenden, in der Hoffnung, dass ihr mir bei meinem Problem behilflich sein könnt. Ich bin neu in der Programmierung und arbeite aktuell mit einem Wago Controller in unserem Labor, der eine Wärmepumpe steuert. Mein Ziel ist es, vier spezifische Werte an eine bestimmte IP-Adresse zu senden. Dazu habe ich versucht, in das vorhandene CODESYS-Programm der Wärmepumpe zusätzliche UDP-Blöcke einzufügen, um die Datenübertragung zu ermöglichen. Leider hat das Senden der Daten bis jetzt nicht funktioniert. Ich habe auch Bilder der Blockkonfiguration beigefügt, um einen besseren Einblick in den Aufbau zu geben. Über jegliche Hilfestellung würde ich mich sehr freuen. Vielen Dank im Voraus!
Last updated: 2024-07-19

Post by andrebrandt on FB string and naming CODESYS Forge talk (Post)
Hi Tim. Not quite correct. What i'd like, is when you place the FB in prog, i choose a block NTC10k, and name this RT401. What i'm trying to do, is to get the name RT401 automaticly into the FB, so i can put this into the string i pass in a struct. So in var in POU, i saw this a place i could do this, RT401: NTC10k(Tag:='RT401'), but i can't get this to work. I shurly must have had something like this in FB: FUNCTION_BLOCK NTC10k String TAG But it's here where I'm stuck...
Last updated: 2024-09-30

Post by rossanoparis on After un upgrade of "CODESYS Control for Raspberry Pi MC SL" from v4.7 to v4.9 SysFileOpen function stopped working CODESYS Forge talk (Post)
Hello at all. After un upgrade of "CODESYS Control for Raspberry Pi MC SL" from v4.7 to v4.9 SysFileOpen function stopped working. I'm not able to read or write files from the PLC application. Before this upgrade all worked fine. I've read this thread [ https://forge.codesys.com/forge/talk/Engineering/thread/3da9ded84e/ ] Despite I followed that indications I couldn't get my code working again. Perhaps I'm missing something or I didn't understand how to use placeholders at all. Is there a different syntax to use for "SysFileOpen" in order to use placeholders? Thanks in advance for your help. Information Compiler: CODESYS V3.5 SP19 Patch 2 Runtime: codesyscontrol 4.9.0 HW: KUNBUS RevPi Connect S Below the paths I want to access (The entire CODESYSControl_User.cfg file is attached) [SysFile] PlaceholderFilePath.1=/home/pi/hpca/bin, $hpcabin$ PlaceholderFilePath.2=/home/pi/hpca/cfg, $hpcacfg$ PlaceholderFilePath.3=/home/pi/hpca/logs, $hpcalogs$ PlaceholderFilePath.4=/home/pi/hpca/resources, $hpcares$
Last updated: 2023-08-22

Post by sturmghost on Visualization using methods and cyclic ST-calls CODESYS Forge talk (Post)
Im looking for a way to implement ST-code into the visualization element without creating a helper POU or method in my device/application tree. Like visualization properties are evaluated at each VISU_TASK cycle I want to be able to create own ST code which interacts with the visualization interface variables. To be more specific I want to have a property which executes user defined ST-code at each VISU_TASK cycle exactly like its already possible for Input Configuration on various mouse and dialog events. Also a property for initialization (so only executed once) and a timed property would be nice. With the situation right now I'll have to create a POU function which handles the ST-code and misuse a property, like the text variable, to execute this POU function at each VISU_TASK cycle. Or does it exist and I don't know it?
Last updated: 2023-10-02

Post by ph0010421 on How to create a stopwatch? CODESYS Forge talk (Post)
Do you need an 'hours-run' counter? And 1 second resolution is ok? I think you're over-thinking it. (The task time needs to be < 1second) Have a look at the LAD... Then, the time in seconds can be made into hh:mm:ss with this FUNction Declarations: FUNCTION funSecondsToStringTime: string VAR_INPUT InSeconds: UDINT; END_VAR VAR AsString: STRING; Minutes: UDINT; Hours: UDINT; Seconds: UDINT; MinutesAsString: STRING(2); HoursAsString: STRING(2); SecondsAsString: STRING(2); END_VAR and the code: Hours := InSeconds / 60 / 60; //Derive hours Minutes := (InSeconds - (Hours * 60 * 60)) / 60; //Derive minutes Seconds := InSeconds - ((Hours * 60 * 60) + (Minutes * 60));//Derive seconds HoursAsString := UDINT_TO_STRING(Hours); MinutesAsString := UDINT_TO_STRING(Minutes); SecondsAsString := UDINT_TO_STRING(Seconds); IF LEN(HoursAsString) = 1 THEN HoursAsString := CONCAT('0',HoursAsString); END_IF; IF LEN(MinutesAsString) = 1 THEN MinutesAsString := CONCAT('0',MinutesAsString); END_IF; IF LEN(SecondsAsString) = 1 THEN SecondsAsString := CONCAT('0',SecondsAsString); END_IF; AsString := CONCAT(HoursAsString, ':'); //assemble string AsString := CONCAT(AsString,MinutesAsString); AsString := CONCAT(AsString,':'); AsString := CONCAT(AsString, SecondsAsString); funSecondsToStringTime := AsString;
Last updated: 2023-12-08

Post by wbj0t on mobus tcp slave device. read/write holdings with 2 variables. CODESYS Forge talk (Post)
Hi there. I have an issue to read and set time for the controller. In the issue many registers described as writable by 6/16 functions, and, in this time, also(!) readable! For example: I have time registers: min, hour, day, mon, year. By specifications it is possible check time (so I need always update these varibles in loop) and set time by writing these same registers, BUT how to set, if they will immediatle updated by current time after writing? So, I need to separate one address at two variables. I have seen option mark: Overlay of the process image by the holding and input register. I understand this so: When I READ by function 3, I will get variable that connected with the same INPUT address and when I WRITE by 6/16 this will change second variable that connected with HOLDING address. BUT, this mark doesnt work, when I write 6/16 and try to get by function 3, I will get written value instead INPUT variable. So, what to do?
Last updated: 2024-03-20

Post by markushunter on Different behavior between the "Start" button in the IDE and the Cmp function "AppStartApplication()" CODESYS Forge talk (Post)
In our application with CODESYS V3.5 SP19 Patch 5 and the Soft-PLC Name: CODESYS Control Win V3 x64 Typ: 4096 ID: 0000 0004 Version: 3.5.19.50 the application behaves differently when we start the application via Cmp.AppStartApplication(pApp) than when we press the "Start" button in online mode in the IDE. Unfortunately, it looks like the AppStartApplication() function, which is called in the "StopDone" system event, is not able to restart the fieldbus driver correctly, in our case the EtherNet_IP_Scanner: Name: EtherNet/IP Scanner Hersteller: 3S - Smart Software Solutions GmbH Kategorien: EtherNet/IP Scanner Typ: 100 ID: 0000 100B Version: 4.5.1.0 Bestellnummer: 1 And one EtherNet/IP adapter Name: FANUC Robot R30iB Plus Hersteller: FANUC Robotics America Kategorien: EtherNet/IP Remote Adapter Typ: 101 ID: 356_12_4_3 Version: Major Revision=16#3, Minor Revision = 16#1 Beschreibung: EtherNet/IP Target imported from EDS File: fanucrobot0301_r30ibp.eds Device: FANUC Robot R30iB Plus Version Konfiguration 3.5.6.0 The application was cold reset in both cases via CmpApp.AppReset(pApp := pApp, usResetOption := CmpApp.RTS_RESET_COLD. Does anyone know the difference between the functions or services executed by the "START" button in online mode and Cmp.AppStartApplication()? Thanks and best regards, markushunter
Last updated: 2024-03-20

Post by markushunter on Different behavior between the "Start" button in the IDE and the Cmp function "AppStartApplication()" CODESYS Forge talk (Post)
In our application with CODESYS V3.5 SP19 Patch 5 and the Soft-PLC Name: CODESYS Control Win V3 x64 Typ: 4096 ID: 0000 0004 Version: 3.5.19.50 the application behaves differently when we start the application via CmpApp.AppStartApplication(pApp) than when we press the "Start" button in online mode in the IDE. Unfortunately, it looks like the AppStartApplication() function, which is called in the "StopDone" system event, is not able to restart the fieldbus driver correctly, in our case the EtherNet_IP_Scanner: Name: EtherNet/IP Scanner Hersteller: 3S - Smart Software Solutions GmbH Kategorien: EtherNet/IP Scanner Typ: 100 ID: 0000 100B Version: 4.5.1.0 Bestellnummer: 1 And one EtherNet/IP adapter Name: FANUC Robot R30iB Plus Hersteller: FANUC Robotics America Kategorien: EtherNet/IP Remote Adapter Typ: 101 ID: 356_12_4_3 Version: Major Revision=16#3, Minor Revision = 16#1 Beschreibung: EtherNet/IP Target imported from EDS File: fanucrobot0301_r30ibp.eds Device: FANUC Robot R30iB Plus Version Konfiguration 3.5.6.0 The application was cold reset in both cases via CmpApp.AppReset(pApp := pApp, usResetOption := CmpApp.RTS_RESET_COLD. Does anyone know the difference between the functions or services executed by the "START" button in online mode and Cmp.AppStartApplication()? Thanks and best regards, markushunter
Last updated: 2024-03-20

Post by markushunter on Different behavior between the "Start" button in the IDE and the Cmp function "AppStartApplication()" CODESYS Forge talk (Post)
In our application with CODESYS V3.5 SP19 Patch 5 and the Soft-PLC Name: CODESYS Control Win V3 x64 Typ: 4096 ID: 0000 0004 Version: 3.5.19.50 the application behaves differently when we start the application via Cmp.AppStartApplication(pApp) than when we press the "Start" button in online mode in the IDE. Unfortunately, it looks like the AppStartApplication() function, which is called in the "StopDone" system event, is not able to restart the fieldbus driver correctly, in our case the EtherNet_IP_Scanner: Name: EtherNet/IP Scanner Hersteller: 3S - Smart Software Solutions GmbH Kategorien: EtherNet/IP Scanner Typ: 100 ID: 0000 100B Version: 4.5.1.0 Bestellnummer: 1 And one EtherNet/IP adapter Name: FANUC Robot R30iB Plus Hersteller: FANUC Robotics America Kategorien: EtherNet/IP Remote Adapter Typ: 101 ID: 356_12_4_3 Version: Major Revision=16#3, Minor Revision = 16#1 Beschreibung: EtherNet/IP Target imported from EDS File: fanucrobot0301_r30ibp.eds Device: FANUC Robot R30iB Plus Version Konfiguration 3.5.6.0 The application was cold reset in both cases via CmpApp.AppReset(pApp := pApp, usResetOption := CmpApp.RTS_RESET_COLD. Does anyone know the difference between the functions or services executed by the "START" button in online mode and Cmp.AppStartApplication()? Thanks and best regards, markushunter
Last updated: 2024-03-20

Post by sanacfu on looking for v2.3 libraries on v3.5.19 CODESYS Forge talk (Post)
Hi all, I'm new to Codesys and Wago but well versed in Rockwell. I've been tasked with upgrading old Wago 750-880 PLCs that run Codesys v2.3. All I was giving is the original PLC program in v2.3 and the currently running machine. I've spec out to what I believe is a suitable upgrade, the PFC100 2ndGen, 750-8111. As I'm rewriting this code on the Codesys I can't find the same library functions blocks for ethernet settings PLC functions. Currently I'm working on code to get/set the PLC ethernet IP address and HMI IP addresses from the HMI screen. One other function I'm looking for is a warm reset function to the PLC. When googling for this stuff I see a lot of code not in ladder logic. Are these functions now not available to implement in ladder logic? Where can I get more information on finding and implementing this functions? Do I have to buy a license from Codesys to use these functions? The PLC I ordered should be arriving in 2-3 weeks.
Last updated: 2024-03-25

Post by duvanmoreno24 on Modbus writing on value change CODESYS Forge talk (Post)
Yes, I tried to do what you put in the first code. However, I have a problem with that and that is that the inputs must be declared with the type. I have many data types running in my code (real, int, uint, bool) and I can't put them in the same function, another thing is that I need to instantiate that function for everything I want to write to the slave. You put a for to 200 but it means that it has to be the same data type and inside the array, but I want to get them individually. I'm struggling to do it in a good and efficient way like wago's E-cockpit does. in the first screenshot you can see, you simply type in value, change the package of things you want to write in value change and it does everything by itself automatically, without comparing any old and new values and even less having the need to activate a bool. , it is perfect.
Last updated: 2024-04-03

Post by julianramirez on ModbusFB write update CODESYS Forge talk (Post)
Hello everyone, I am testing the ModbusFB library tcp server and so far I am able to create holding registers successfully, however, I am trying to identify after each write which registers got updated (i.e. function code, write value). I can even see the var udiNumWriteRequests, which increases with every write. I noticed that there is logging with the LogStatusInfo method. After I call it I am able to read in the console stuff that I want. Nevertheless, this is only available at the logs and is not easy to decode because it consists on several messages, I would like to know if there is a way for me to retrieve this information from the function itself with pointers or if there is any way to copy the logs messages (assuming that I can filter them with the LoggingOptions to only show what I need) inside the runtime code and not in the console. Thanks for your help :)
Last updated: 2024-09-16

Post by hwillems on Ranges, Lambdas, on Fixed arrays of structs CODESYS Forge talk (Post)
I do datastructures and algorithms in Codesys. For example a Struct of Person with thing's like IdNumber, Name, Age etc. as example. Now i do all kind of calculations, filters. So i have this pretty big Fixed Array with Structs. On this struct i want to do simple stuff you can do easily in C++/Python/Rust etc. For example i want to do this: AvererageAge := Average(Peoples.Age); Then it will return the average of all members ages. Or Sort struct on age etc. Or sort on alphabetical Name. Or use Lambda functions to filter/mutate out things like, filter out everybody above 18 years old. Or remove people who it's name start with "A". Currently i have to write my own custom function for example sorting on Age. And make a super specific function based on that particulare datastructure. Here an Example: (*Before calling this FIlter method, set the mNodeFilterSwitch to the desired filter.*) CASE mNodeFilterSelect OF (********************************[ Status Filters ]***********************************) NodeID: FOR x := ACS_OUT_BEGIN TO ACS_OUT_END BY 1 DO FOR y := ACS_IN_BEGIN TO ACS_IN_END BY 1 DO IF marrNode[y].Status.oiNodeID > marrNode[y + 1].Status.oiNodeID THEN mNodeTemp := marrNode[y + 1]; marrNode[y + 1] := marrNode[y]; marrNode[y] := mNodeTemp; END_IF; END_FOR; END_FOR; Started: FOR x := DES_OUT_BEGIN TO DES_OUT_END BY -1 DO FOR y := DES_IN_BEGIN TO DES_IN_END BY -1 DO IF marrNode[y].Status.oxStarted > marrNode[y - 1].Status.oxStarted THEN mNodeTemp := marrNode[y - 1]; marrNode[y - 1] := marrNode[y]; marrNode[y] := mNodeTemp; END_IF; END_FOR; END_FOR; Starting: FOR x := DES_OUT_BEGIN TO DES_OUT_END BY -1 DO FOR y := DES_IN_BEGIN TO DES_IN_END BY -1 DO IF marrNode[y].Status.oxStarting > marrNode[y - 1].Status.oxStarting THEN mNodeTemp := marrNode[y - 1]; marrNode[y - 1] := marrNode[y]; marrNode[y] := mNodeTemp; END_IF; END_FOR; END_FOR; END_CASE; I have like 30+ of these in the enum. Not really DRY code right? These are custom made bubble sort filters in a function. You pass in the Datastructure, and say what function you want. (This is an enum collection of sorting functions) And then the Array with Nodes of Structs gets ordered. Why can't we have Iterators and Lambda's and build in standard functions like regular languages? Also i use bubble sort because it's the easiest to implement because i can't get this to code DRY. Problem with ST (Even the new one with classes) that it's very limited for programming datastructures and algorithms. Yes you still not want dynamic memory and you need to choose the correct algorithm so you know the most extreme edge cases regarding the time it takes to execute the algorithms.(Real-time execution) How are other people dealing with this? Here for example saw some software using an adjusted ST language and having FOR EACH possibility: https://www.fernhillsoftware.com/help/iec-61131/structured-text/st-for-each.html You can then build your own custom Iterator functions. I wish the IEC 61131-3 standard would be more expressive and having more standard modern features, but still keep close to the fact of no dynamics memory and real-time systems.
Last updated: 2023-08-31

Post by fabian on Sys Process Execute Command CODESYS Forge talk (Post)
Hello, I have a question: Once the command is being executed, is there a way to kill it again? As the called application is running in the background, the user can't close it but it shall be closed/terminated, commanded by codesys. I have tried with "SysProcessTerminate" but I guess this is not correct as the RTE crashes when this function is called. Starting the application: IF GVL.xStrtQR THEN GVL.xStrtQR := FALSE; SysProcess.SysProcessExecuteCommand2(pszCommand:=sCmd, pszStdOut:=stdout, udiStdOutLen:= SIZEOF(stdout),pResult := ADR(GVL.pResQRTsk)); END_IF Trying to stop it again: IF GVL.xTrmQR THEN GVL.xTrmQR := FALSE; pResTerm := SysProcess.SysProcessTerminate(hProcess:=SysProcess.SysProcessGetCurrentHandle(pResult:=ADR(GVL.pResQRTsk))); END_IF Codesyscontrol Win x64, 3.5.19.10. Many thanks for any advice pointing to the correct direction.. :-) Regards, Fabian
Last updated: 2023-11-17

Post by jegerjon on Testing of Codesys program CODESYS Forge talk (Post)
I have a simulation function that toggle xSimActive. I map all IO variables to "IO GVLs" when xSimActive=0. I map IO corresponding SimIO GVL to "IO GVLs" when xSimActive=1. Then I write code for the simulation program that runs when xSimActive=1. Typically increase flow corresponding to pump speed, simulate tankfilling corresponding to flow and so on. I made a FC that require a correct code to activate simulation to avoid unintended activation by service dept. When comissioned remove any possibility to activate simulation. Super when officetesting and supporting service dept. + cheap as it requires no additional equipment, and it is easier to support customer later on in the life cycle as you can test proposed changes without setting up a testlab.
Last updated: 2023-12-07

Post by jegerjon on Testing of Codesys program CODESYS Forge talk (Post)
I have a simulation function that toggle xSimActive. I map all IO variables to "IO GVLs" when xSimActive=0. I map IO corresponding SimIO GVL to "IO GVLs" when xSimActive=1. Then I write code for the simulation program that runs when xSimActive=1. Typically increase flow corresponding to pump speed, simulate tankfilling corresponding to flow and so on. I made a FC that require a correct code to activate simulation to avoid unintended activation by service dept. When comissioned remove any possibility to activate simulation. Super when officetesting and supporting service dept. + cheap as it requires no additional equipment, and it is easier to support customer later on in the life cycle as you can test proposed changes without setting up a testlab.
Last updated: 2023-12-07

Post by mohammadasif on Blink Function definition is wrong in codesys online help CODESYS Forge talk (Post)
https://content.helpme-codesys.com/en/libs/Util/Current/Signals/BLINK.html in the above link, please correct your website the following: "Output value, starts with FALSE and switches between TRUE and FALSE for the given high and low times" it should actually be: "Output value, starts with TRUE and switches between TRUE and FALSE for the given high and low times" if not please let me know if this has changed in a util library update, in your older website it has the right definition here: https://help.codesys.com/webapp/blink;product=codesys;version=3.5.11.0
Last updated: 2023-12-28

Post by fajean on Issues with "Add all instance path" CODESYS Forge talk (Post)
In the past, we have routinely used the "add all instance paths" function to automatically add variables to VAR_CONFIG lists. My recollection is that compiling a project did not require VAR_CONFIG to be fully populated, and, once successfully compiled, instance paths could be added. Errors related to missing declarations, if I recall correctly, were thrown when downloading to the PLC, they did not prevent a successful compile. At some point, it stopped working. Missing declarations in a VAR_CONFIG now cause a compile error, so the application is never "current", the only reason I can see being the missing VAR_CONFIG declarations themselves (no other error). We observe the same behavior across all our projects. This is really aggravating, and I must be missing something simple. We use 3.5 SP17p3, 64 bits. Can anyone help?
Last updated: 2023-12-29

Post by alexgooi on Codesys licensing explanation CODESYS Forge talk (Post)
Dear Forum, We are currently switching to a native Codesys controller, and I'm currently trying to determine the correct license. I have a question regarding the Modbus instances. With the Standard S license this is set to 4 (See picture). In our projects we are using a lot of communications to Modbus servers using a Codesys Controller, for this communication I'm using the ModbusFB library (supplied by 3S) (see picture). In my project I would like to use more than 4 instances of the ClientTCP FB. My question is, is this now capped at 4 possible connections with the standard S license. Or do these function blocks have a different relation with the license? Some clarity on this topic would be very welcome. Thank you in advance
Last updated: 2024-02-15

<< < 1 .. 22 23 24 25 26 > >> (Page 24 of 26)

Showing results of 649

Sort by relevance or date