Sending Data to OpenSplice (DDS) - data-distribution-service

I'm new to DDS and opensplice, so this may be simple, but I don't understand it.
I am reading about reader caches and writer caches in the opensplice documentation. I understand that data goes into the datawriter cache and is then sent to datareader caches. But how do you push the information you have to the datawriter cache in the first place?
Is there a seperate command for that or does data automatically get sent to the cache when you publish or subscribe a device or application to a topic?
I guess in all, my question is, how does data get into opensplice/ the datawriter cache?
I appreciate any help. Like I said, I've been reading through tutorials and reference guides. I see plenty about what happens when the info is in opensplice, but I can't figure out how you put it there. If possible, could you link to an example too please?
Thanks

Actually .. its as simple as doing a write() or read() for your topic, so its a straightforward API call to provide 'samples' to DDS (i.e. publishing data) or to extract 'samples' from DDS (i.e. reading subscribed data).
As Reinier suggested too, it typically helps to look at some of the bundled examples (you could start with the famous 'HelloWorld") on how to create the publisher/subscriber and reader/writer 'entities' that allow you to interact with DDS from your application (in its 'language of choice')
Note: the examples are located here (for a 32-bit linux installation):
/HDE/x86.linux/examples/dcps/
The source for the Helloworld example (for Java) would then be here:
/HDE/x86.linux/examples/dcps/HelloWorld/java/src

Related

Configure .eds file to map channels of a CANopen Client PLC

In Order use a PLC as a Client (formerly “Slave”), one has to configure the PDO channels, since the default values of the manufacturer are often not suitable. In my case, I need the PDOs so send INT valued instead of the default UNSIGNED8 (see. Picture).
Therefore my question: What kind of workflow would you recommend, to map the CANopen Client PDO channels?
I found the following workflow suitable, however I appreciate any improvements and recommendations from your side!
Start by locating the .eds file from the manufacturer. The image show this in the B&R Automation Studio Programming Environment
Open the file in a eds. Editor. I found the free Vector CANEds Editor very useful. Delete all RxPODs and RxPDO mappings that you don’t need.
Assign the needed Data Type (e.g. INTEGER16) and Channel Name (“1 Byte In (1)”).
Add the necessary PDOs and PDO mapping from the database. (This might actually be a bug, but if you just edit the PDOs without deleting and recreating them, I always receive error messages)
Map the Date to the Channels
Don't forget to write the number of channels in the first entry (in this image: 1601sub0)
Check the eds file for Errors (press F5) and copy&paste the eds file to the original location point 1.)
Add the PLC Client device in Automation Studio and you should see the correct mappings.
(PS: I couldn't make the images smaller ... any recommendations about formating this question are welcome!)

Why should I use ILogger or Serilog?

As the question suggests, why should I use ILogger or Serilog or any other 3rd party logger for that matter. I have absolutely nothing against either or any 3rd party loggers. I've traditionally always rolled my own, I don't find it difficult or time consuming, more often than not I've just reused/rehashed something I've written before.
I'm not looking to bash anything. But from what I've read they pretty much do what my logger does and that's just simple messages and time stamps so I can see whats going on. I capture this
Date/Time
Message or error message
Module that added the log (name)
Logged in user (if my app has users)
I'm just looking to see what the community thinks
For Serilog, I've recently been through a series of article that explains it fairly well: https://ranjeet.dev/All-about-structured-logging-introduction/
The main reason is to leverage structured logging, which consists in adding machine friendly meta data, on top of classical human friendly string based logging. When you end up with a big system in production, this is a gamer changer, because going through Gb of text files would be very unproductive. Then, on top of that, you get a very well thought framework with addins and integration to easily manipulate your logs.

SAP B1 - using stanard dll's in a SOAP web service

Currently, I am working with SAP Business One SDK. I took some project from another team. This project is a SOAP web service. It has been written in ASPX technology, anyway another team used standard DI API library. This is the main problem with this solution because it causes a lot of problems with memory leaks.
In source code after every operation when DI API is called I try to use Garbage Collector, but unfortunately, it is not enough.
The web service is hosted on IIS and I had to set an option that for some time restart it. I know it is not the best solution, but it works. Obviously, that way generates many problems.
I have a question about it. Does any reasonable solution exist? Or I will have to rewrite source code using DI Server?
I have read a lot about this, I found some articles on the Internet. Please do not put any links in comments, because I am quite sure that I have read them.
Every time you use a DI API object you have to release it. Otherwise, it will stay in memory and it will cause the memory leak you mentioned.
The correct way to release them is to use ReleaseComObject. Remember that if the object is null you will get an exception so check it first.
if (oDocuments != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oDocuments);

Is It Posssible To Access AwesomePlayer Info And Error Messages From An Application?

I'm an untrained, newbie code hacker playing with a homebrew MediaPlayer for streaming live internet audio. An old fashioned "radio" if you will. I'm using OnInfo, OnError and OnBuffferingUpdate info to fill a "status" textView box on my player, but I see so much more detailed info in logcat from the AwesomePlayer engine. Is it possible to access the AwesomePlayer info directly from the application?
From an application perspective (assuming the application is written in JAVA), MediaPlayer is the abstraction for all player engines. There are multiple player engines such as StagefrightPlayer which internally uses AwesomePlayer and NuPlayer to name a couple.
The information made available on listeners i.e. onInfoListener, onBufferingUpdateListener, onErrorListener originates from AwesomePlayer which is translated into a generic message and is communicated through the listeners. This information is deemed to be sufficient for any application developer to develop their code around the same.
AwesomePlayer logs are more from debug perspective and helps to understand the underlying implementation of the engine. I feel that this information is good to know and understand, but not sure if this is essential for application development.
To summarize, AwesomePlayer information is actually communicated through the listeners which are generic in nature and rest of the logcat information is more for debug or understanding purposes. Currently, there is no scheme to get this information unless the developer explicitly customizes the AOSP distribution.

Instant Messenger API

I need just a simple Objective-C app or API that can send and receive IMs to a single user.
BARE BONES.
I've looked at Skype, but the Objective-C part looks really outdated. AIM is preferred, but anything that can send and receive IMs is perfect.
Is there an API for this? For AIM or Skype?
Examples would be appreciated, and remember, I'm totally new to Obj-C.
I don't know about simple or bare bones, but Adium is a good open-source IM client for OS X written in Cocoa.
UDPATE: You might want to check out this blog post ("Towards an Open Source XMPP Framework for Cocoa"). It looks like the author wanted his own Jabber/XMPP Cocoa framework, too, and has even created a project for it in Google Code.
I am currently working on an Objective-C implementation of the OSCAR (AIM) protocol. It is being updated on GitHub. If I understand what you want to do correctly, the library, although incomplete, will meet your needs. It can send and receive messages, and work with status messages. It can also read the buddy list if you are interested in that. The entire library should be finished by the end of the month, and you can check it out on GitHub:
https://github.com/unixpickle/LibOrange
Signing on is this simple:
login = [[AIMLogin alloc] initWithUsername:username password:password];
[login setDelegate:self];
if (![login beginAuthorization]) {
NSLog(#"Failed to start authenticating.");
abort();
}
Once signed on, sending messages works like this:
AIMMessage * reply = [AIMMessage messageWithBuddy:[message buddy] message:#"Test"];
[theSession.messageHandler sendMessage:reply];
Obviously, you can check out the sample on GitHub, but I thought I would put that sample code to wet your appetite. Enjoy!
I don't know exactly how hard it would be to use, but isn't there an open source library for accessing IMs called libPurple? maybe you should check that out and see what it can do in Xcode.
If it's for a small scale deployment, it would be pretty easy to roll your own using Distributed Objects. I've heard it can be problematic trying to use DO for a high traffic Internet service though.