LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SNMP implementation

So you are trying to set the device as follows: 0 Enabled Phase, 1 Automatic Flash Entry Phase and 4 Non-Actuated 2. Are you using the correct index to the table? Are you sure the index of the device (phase number) that you want to set is 14? If the SET community name is different I can't help you there. That is essentially a password and would be device dependent. The default for sets is either public or private. If it has been changed to something else you will need to find out what it is. Are you sure you formated the value correctly? From your pictures I do not see where you formated the value itself.

 

Also, as a side note you may want to avoid code that requires that much scrolling. It gets very hard to debug when your wire are a mile long.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 41 of 53
(1,344 Views)

The phase number 14 was just an example, the program will give the user the option to decide which phase to set, so the last octect will be different of course because it is directly related with the phase number. I'm worried because the program doesn't even set the lowest significant bit (Enable phase). What do you mean by using the correct index in the table? as far as I know there are 16 entries in this specific case, one per phase. Let me attach you the formatting so you can take a look, but as far as I know, the OID/TYPE/VALUE is getting it right just into the entry of the SET Vi. If it helps I could also attach my Vi if you need it, thanks in advance for all the help

0 Kudos
Message 42 of 53
(1,341 Views)

The index is the phase number. If there are 16 then 14 should be valid. Can you post the results of a MIB walk? If you are not setting the enable bit then perhaps you are not formatting that value correctly. That could explain the GenErrior you are getting.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 43 of 53
(1,337 Views)

here I attach my VI, I can't do a MIB walk right now because I'm not in front of the MIB agent at this time of the night, so I have no connection with it. Let me explain a little more. When I try to work on phases that are already enabled, it does nothing, the GET works fine, but the SET does nothing. When I try to enable a new phase, let's say phase 10, it does nothing, that is my current problem, that's why I was thinking that it could be a community name problem, but the manufacturer of the device hasn't get back to me yet.If you find another problem on my VI let me know because sincerely I don't see any errors of mine

0 Kudos
Message 44 of 53
(1,334 Views)

Your code looks like it was formatting things correctly though it could be coded much more efficiently. See the example I have attached. The clsuter to array will work provided the elements in the cluster are ordered the same as the bit fields. To reorder the elements in a cluster right click on the cluster and select "Reorder Controls in Cluster".

 

SNMP_Help.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 45 of 53
(1,328 Views)

thanks for the advice, you see? it's weird the set is not working with those OIDs I'm not sure if it has something to do with the bitfield thing but I really suspect on the community name

0 Kudos
Message 46 of 53
(1,325 Views)

Hi Mark, I have a new problem with your Set Vi, when I try to set a value to a certain object, let´s say 127, the device is responding with -127, or if I try to set a value greater than 127, eg:250 it shows a badvalue error even though the object its defined for values between 0 and 255, what could I do to get your VI to work properly? 

0 Kudos
Message 47 of 53
(1,300 Views)

I suspect that it is a bad SNMP implementation in the device itself. One thing you can try is to make sure that you ensure the type is either signed or unsigned on the set. SNMP has different formatting for these and I suspect that your device is not adhering to this part of the protocol. Just in case the version you have is a bit dated here is my latest version.

 

Also, I am posting this code "as is". I can answer some questions but I am not officially supporting this code for public consumption.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 48 of 53
(1,296 Views)

I will try with your updated library. So far it works great except for that, I also think that may be a bug from the device since when I do the GET operation I can see values greater than 127 but when I try to do the SET operation is when the problems appear with values greater tan 127 on that specific object that should support from 0 to 255. I have tried with U8, U16 and U32 with no results, and also tried setting values let´s say -1 or -127 without any success.

 

Once again thank you very much for creating that snmp library since it have been really helpful and I have had a great performance on the overall of my program

0 Kudos
Message 49 of 53
(1,290 Views)

I am not referring to the data type within LabVIEW. I am referring to the value you pass in the OID array for the Set VI. The input to that is a 2D array with each row containing the OID, Type and Value. This type must be set to reflect whether the value is signed or unsigned. The PDU has a different encoding for based on whether it is a signed or unsigned integer.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 50 of 53
(1,288 Views)