Activate camera in station- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: Activate camera in station (/Thread-Activate-camera-in-station) |
Activate camera in station-Alec.Zitzelberger-07-14-2021 I am currently trying to figure out how to take the pre-existing camera items in my RDK workstation and activate them instead of doing a Cam2dAdd and making new cameras. Is there a way to do this in the C# API? I found it odd that there is a Cam2dClose function, but no Cam2dOpen. RE: Activate Camera in Station-Vineet-07-15-2021 Hello, This is possible using the setParam method in Python, which I think is SetParameter in C#.
Code:
camera = RDK.Item('Camera 1')
RE: Activate Camera in Station-Alec.Zitzelberger-07-15-2021 (07-15-2021, 01:23 PM)Vineet Wrote:Hello, I tried the following in C# camera.setParam("Open") and I get the following error despite the camera activating in the RDK window. "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" Note: I am using the RoboDK.cs from the SampleProject for this, if that matters. RE: Activate Camera in Station-Vineet-07-15-2021 Hello, Here is the code I tried and it works fine. Can you try this?
Code:
using System;
RE: Activate Camera in Station-Alec.Zitzelberger-07-15-2021 (07-15-2021, 07:25 PM)Vineet Wrote:Hello, I inserted the code into the function and executed it. "Connect status: True" is printed to the Console, and then the program crashes. /// /// Send a specific parameter to RoboDK. This is reserved for internal purposes. /// /// Item parameter /// value /// public string setParam(string param, string value = "") { link._require_build(7129); link._check_connection(); link._send_Line("ICMD"); link._send_Item(this); link._send_Line(param); link._send_Line(value); 字符串响应= link._recv_Line(); <<< Crash Happens Here link._check_status(); return response; } It appears to crash while waiting for a response from the RDK window. I'm curious if I am using an old version of the API code. |