12-15-2005 07:47 AM
12-19-2005 08:30 AM
Hi Becktho,
First of all the warning and the error you got means that there are Bus Problems and your controller had entered the error passiv status. The first thing you should verify is the Bus Termination foir your connection. To assume it is High Speed CAN, take care that your system uses two 120 Ohm resistors on both ends of your system, but not more.
The second is, you are using the SDO VI inside a while loop. Normaly this VI was written to be used for single command tasks, not for continuously operations. It may that the 100 ms timing is to fast for the device, because it uses Object configuration or for your network, because SDO Priority is not that high.
To find a solution, it would be nice if you could explain some more details about your needs. What are you doing with a SDO in a while loop?
Thanks
DirkW
12-19-2005 09:10 AM
12-20-2005 09:28 AM
01-05-2006 04:44 AM
Hallo Dirk
Ich switche jetzt auf Deutsch, nachdem ich in deinem Beispiel-Code einen Kommentar auf Deutsch gesehen habe.
War heute wieder an diesem Prüfstand und habe dein Programm mal laufen gelassen und dabei folgendes Verhalten gehabt:
1. Kein Problem bis zur Funktion "ncWriteObj.vi" - dort wurde eine Warnung zurück geliefert.
2. In der Funktion "ncReadNetMult.vi" wurde dann ein Fehler (siehe Attachment) ausgelöst.
Leider macht diese Fehlermeldung irgendwie nicht so wirklich Sinn, da die Busteilnehmer mit Spannung versorgt sind. Die ganze Verkabelung wurde, wie vorher schon mal erwähnt, mit einem anderen Programm (ext. SW) und dem Notebook eines Kollegen getestet. Dieser Kommuniziert über eine Softing CANUsb-Schnittstelle mit den CAN-Devices - ohne Probleme und mit der selben Prüfstandeinstellung wie ich das Versuche. Der Bus ist in den Geräten 2x mit 120Ohm abgeschlossen - also müsste auch das passen.
Ebenfalls angehängt habe ich dein Programm, so wie ich es getestet habe.
Für weitere Tipps und Infos bin ich sehr dankbar. Ich werde in den nächsten Tagen auch mal versuchen über diese Softing Schnittstelle zu kommunizieren. Trotzdem ist mein Schlussziel immer noch die Verwendung der NI-Karte.
Danke für deine Bemühungen.
Thomas
01-05-2006 08:35 AM
Hallo Thomas,
Ja, ist ist zwar im Forum immer besser in Englisch, weil dann mehr Leute etwas davon haben aber jetzt wo wir mehr ins detail gehen muessen ist es vielleicht ion Deutsch besser.
Der Fehler bedeutet eigentlich nur das Client und Server irgendwie nicht miteinander kommunizieren koennen. Nachdem wir ja ein Kabel oder Abschlussproblem ausschliessen koennen, kann es eigentlich nur noch an der Baudrate oder einer falschen COB ID liegen.
Wie arbeiten denn deine Geraete genau. Dein VI arbeitet mit einer SDO Anfrage. Willst du einen einzelwert abfragen oder eine Uebertragung von mehreren Werten ausloesen?
Wenn du den Busmonitor in der richtigen Baudrate ueber den MAX (measurement und Automation Explorer) startes, empfaengst du da irgendwas von deinen Geraeten ohne das du irgendwas sendest?
Normalerweise Sendet ein Geraet seine daten ueber PDO's die entweder selbsstaendig gesendet werden oder ueber ein Remote Frame abgefragt werden.
Die Frage ist, was erwarten deine Geraete. Vielleicht koenntest du kurz die Anleitung zu einem deiner Geraete anhaengen und beschreiben was du genau auslesen willst?
Ich koennte dann mal erklaeren wie ich es machen wuerde.
PS. NI wird im Februar eine CANopen Library fuer NI CAN und unsere Karten herausbringen. Das sollte dann einiges erleichtern. Vielleicht hast du ja Lust einen Beta Test zu machen?
DirkW
02-06-2006 05:01 AM
02-06-2006 11:08 AM
Hi Thomas,
I try to answer your question in english because of the feedback from the forumand to give other users the chance to read this thread too.
I did the same stuff years ago and I tried it ones again. It seems you have an failure in your application. To write to an object dictionary you have to write an SDO 601h (1537d) and to Read an SDO 581h(1409d) to get the answer about what you have written. The 601h ID uses 22h in Byte 0 to indicate it is a write and you will get back ID 581 with 60h in Byte 0, which mean everything worked ok. So perhaps you sent the wrong message first?
If you read from a object dictionary the Byte0 is 40h for ID 601h and the answer has 42h in Byte0 for ID 581h.
ID 181 to 183 are typically digital data PDO's which are send automatically some times. This depends to the configuration and should be changeable using a SDO.
Attached you will find an example reading the manufacturee name using a SDO.
DirkW
02-07-2006 03:02 AM
Hi Dirk
Thanks so far - I'll have another try as soon as possible.
You mentioned several hex-values (22h = write, 60h = ok, 40h, 42h) - could you tell me where I can find a definition of these values?
Thomas
02-07-2006 04:02 AM
Hi Dirk
I just tested it the way you described and it worked. In the attached VI you can see the values I wrote and what Data I received. Now - could you tell me how I could read specific objects in an easier way?
As you can see, I sent some kind of request and got an entry from ID 581 in the read Data (I stopped the loop after detecting that). Now this dataset is from index 2301h, Sub-index 4Ah. Well, I could check the string for ID 581 and read out the index and sub-index, but I wonder if there was an easier way to read this specific data. If so, could you describe it referring to the vi attached or maybe modify it?
Thanks in advance.
Thomas